diff --git a/.fernignore b/.fernignore
index 990d6755..d7e75b72 100644
--- a/.fernignore
+++ b/.fernignore
@@ -6,7 +6,7 @@ src/elevenlabs/conversational_ai/conversation.py
src/elevenlabs/conversational_ai/default_audio_interface.py
src/elevenlabs/realtime_tts.py
src/elevenlabs/play.py
-src/elevenlabs/webhooks.py
+src/elevenlabs/webhooks_custom.py
# Ignore CI files
.github/
diff --git a/pyproject.toml b/pyproject.toml
index 693641c8..72a80f40 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@ name = "elevenlabs"
[tool.poetry]
name = "elevenlabs"
-version = "v2.4.0"
+version = "v2.5.0"
description = ""
readme = "README.md"
authors = []
diff --git a/reference.md b/reference.md
index 1b3a11cb..0d3637eb 100644
--- a/reference.md
+++ b/reference.md
@@ -2040,6 +2040,260 @@ client.text_to_voice.create_voice_from_preview(
+
+
+
+
+client.text_to_voice.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.text_to_voice.create(
+ voice_name="Sassy squeaky mouse",
+ voice_description="A sassy squeaky mouse",
+ generated_voice_id="37HceQefKmEi3bGovXjL",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**voice_name:** `str` — Name to use for the created voice.
+
+
+
+
+
+-
+
+**voice_description:** `str` — Description to use for the created voice.
+
+
+
+
+
+-
+
+**generated_voice_id:** `str` — The generated_voice_id to create, call POST /v1/text-to-voice/create-previews and fetch the generated_voice_id from the response header if don't have one yet.
+
+
+
+
+
+-
+
+**labels:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — Optional, metadata to add to the created voice. Defaults to None.
+
+
+
+
+
+-
+
+**played_not_selected_voice_ids:** `typing.Optional[typing.Sequence[str]]` — List of voice ids that the user has played but not selected. Used for RLHF.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.text_to_voice.design(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.text_to_voice.design(
+ voice_description="A sassy squeaky mouse",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**voice_description:** `str` — Description to use for the created voice.
+
+
+
+
+
+-
+
+**output_format:** `typing.Optional[TextToVoiceDesignRequestOutputFormat]` — Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
+
+
+
+
+
+-
+
+**model_id:** `typing.Optional[VoiceDesignRequestModelModelId]` — Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.
+
+
+
+
+
+-
+
+**text:** `typing.Optional[str]` — Text to generate, text length has to be between 100 and 1000.
+
+
+
+
+
+-
+
+**auto_generate_text:** `typing.Optional[bool]` — Whether to automatically generate a text suitable for the voice description.
+
+
+
+
+
+-
+
+**loudness:** `typing.Optional[float]` — Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
+
+
+
+
+
+-
+
+**seed:** `typing.Optional[int]` — Random number that controls the voice generation. Same seed with same inputs produces same voice.
+
+
+
+
+
+-
+
+**guidance_scale:** `typing.Optional[float]` — Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
+
+
+
+
+
+-
+
+**quality:** `typing.Optional[float]` — Higher quality results in better voice output but less variety.
+
+
+
+
+
+-
+
+**reference_audio_base_64:** `typing.Optional[str]` — Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.
+
+
+
+
+
+-
+
+**prompt_strength:** `typing.Optional[float]` — Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
@@ -3369,6 +3623,14 @@ typing.Optional[core.File]` — See core.File for more documentation
-
+**csv_fps:** `typing.Optional[float]` — Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.
+
+
+
+
+
+-
+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -4462,8 +4724,7 @@ client.workspace.update_user_auto_provisioning(
-## Webhooks
-client.webhooks.list(...)
+client.workspace.get_default_sharing_preferences()
-
@@ -4475,7 +4736,7 @@ client.workspace.update_user_auto_provisioning(
-
-List all webhooks for a workspace
+Get the user's default sharing preferences.
@@ -4495,8 +4756,199 @@ from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
-client.webhooks.list(
- include_usages=False,
+client.workspace.get_default_sharing_preferences()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.workspace.update_default_sharing_preferences(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update the user's default sharing preferences.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.workspace.update_default_sharing_preferences(
+ default_sharing_groups=["default_sharing_groups"],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**default_sharing_groups:** `typing.Sequence[str]` — List of group IDs to share with by default
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.workspace.get_share_options()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get the share options for a workspace.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.workspace.get_share_options()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Webhooks
+client.webhooks.list(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+List all webhooks for a workspace
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.webhooks.list(
+ include_usages=False,
)
```
@@ -6012,7 +6464,7 @@ client.conversational_ai.agents.list()
-client.conversational_ai.agents.simulate_conversation(...)
+client.conversational_ai.agents.duplicate(...)
-
@@ -6024,7 +6476,7 @@ client.conversational_ai.agents.list()
-
-Run a conversation between the agent and a simulated user.
+Create a new agent by duplicating an existing one
@@ -6039,23 +6491,13 @@ Run a conversation between the agent and a simulated user.
-
```python
-from elevenlabs import (
- AgentConfig,
- ConversationSimulationSpecification,
- ElevenLabs,
-)
+from elevenlabs import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
-client.conversational_ai.agents.simulate_conversation(
+client.conversational_ai.agents.duplicate(
agent_id="21m00Tcm4TlvDq8ikWAM",
- simulation_specification=ConversationSimulationSpecification(
- simulated_user_config=AgentConfig(
- first_message="Hello, how can I help you today?",
- language="en",
- ),
- ),
)
```
@@ -6080,15 +6522,7 @@ client.conversational_ai.agents.simulate_conversation(
-
-**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated
-
-
-
-
-
--
-
-**extra_evaluation_criteria:** `typing.Optional[typing.Sequence[PromptEvaluationCriteria]]` — A list of evaluation criteria to test
+**name:** `typing.Optional[str]` — A name to make the agent easier to find
@@ -6108,7 +6542,7 @@ client.conversational_ai.agents.simulate_conversation(
-client.conversational_ai.agents.simulate_conversation_stream(...)
+client.conversational_ai.agents.simulate_conversation(...)
-
@@ -6120,7 +6554,7 @@ client.conversational_ai.agents.simulate_conversation(
-
-Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.
+Run a conversation between the agent and a simulated user.
@@ -6144,7 +6578,7 @@ from elevenlabs import (
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
-client.conversational_ai.agents.simulate_conversation_stream(
+client.conversational_ai.agents.simulate_conversation(
agent_id="21m00Tcm4TlvDq8ikWAM",
simulation_specification=ConversationSimulationSpecification(
simulated_user_config=AgentConfig(
@@ -6204,8 +6638,7 @@ client.conversational_ai.agents.simulate_conversation_stream(
-## ConversationalAi PhoneNumbers
-client.conversational_ai.phone_numbers.create(...)
+client.conversational_ai.agents.simulate_conversation_stream(...)
-
@@ -6217,7 +6650,7 @@ client.conversational_ai.agents.simulate_conversation_stream(
-
-Import Phone Number from provider configuration (Twilio or SIP trunk)
+Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.
@@ -6232,20 +6665,22 @@ Import Phone Number from provider configuration (Twilio or SIP trunk)
-
```python
-from elevenlabs import ElevenLabs
-from elevenlabs.conversational_ai.phone_numbers import (
- PhoneNumbersCreateRequestBody_Twilio,
+from elevenlabs import (
+ AgentConfig,
+ ConversationSimulationSpecification,
+ ElevenLabs,
)
client = ElevenLabs(
api_key="YOUR_API_KEY",
)
-client.conversational_ai.phone_numbers.create(
- request=PhoneNumbersCreateRequestBody_Twilio(
- phone_number="phone_number",
- label="label",
- sid="sid",
- token="token",
+client.conversational_ai.agents.simulate_conversation_stream(
+ agent_id="21m00Tcm4TlvDq8ikWAM",
+ simulation_specification=ConversationSimulationSpecification(
+ simulated_user_config=AgentConfig(
+ first_message="Hello, how can I help you today?",
+ language="en",
+ ),
),
)
@@ -6263,7 +6698,7 @@ client.conversational_ai.phone_numbers.create(
-
-**request:** `PhoneNumbersCreateRequestBody`
+**agent_id:** `str` — The id of an agent. This is returned on agent creation.
@@ -6271,26 +6706,121 @@ client.conversational_ai.phone_numbers.create(
-
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated
-
-
+
+-
+**extra_evaluation_criteria:** `typing.Optional[typing.Sequence[PromptEvaluationCriteria]]` — A list of evaluation criteria to test
+
-
-client.conversational_ai.phone_numbers.get(...)
-
-#### 📝 Description
-
-
--
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## ConversationalAi PhoneNumbers
+client.conversational_ai.phone_numbers.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Import Phone Number from provider configuration (Twilio or SIP trunk)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+from elevenlabs.conversational_ai.phone_numbers import (
+ PhoneNumbersCreateRequestBody_Twilio,
+)
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.phone_numbers.create(
+ request=PhoneNumbersCreateRequestBody_Twilio(
+ phone_number="phone_number",
+ label="label",
+ sid="sid",
+ token="token",
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `PhoneNumbersCreateRequestBody`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.conversational_ai.phone_numbers.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
-
@@ -6759,6 +7289,462 @@ client.conversational_ai.knowledge_base.list()
+
+
+
+
+## ConversationalAi Tools
+client.conversational_ai.tools.list()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all available tools available in the workspace.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.tools.list()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.conversational_ai.tools.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Add a new tool to the available tools in the workspace.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import (
+ ElevenLabs,
+ ToolRequestModel,
+ ToolRequestModelToolConfig_Client,
+)
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.tools.create(
+ request=ToolRequestModel(
+ tool_config=ToolRequestModelToolConfig_Client(
+ name="name",
+ description="description",
+ expects_response=False,
+ ),
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `ToolRequestModel`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.conversational_ai.tools.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get tool that is available in the workspace.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.tools.get(
+ tool_id="tool_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tool_id:** `str` — ID of the requested tool.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.conversational_ai.tools.delete(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete tool from the workspace.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.tools.delete(
+ tool_id="tool_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tool_id:** `str` — ID of the requested tool.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.conversational_ai.tools.update(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update tool that is available in the workspace.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import (
+ ElevenLabs,
+ ToolRequestModel,
+ ToolRequestModelToolConfig_Client,
+)
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.tools.update(
+ tool_id="tool_id",
+ request=ToolRequestModel(
+ tool_config=ToolRequestModelToolConfig_Client(
+ name="name",
+ description="description",
+ expects_response=False,
+ ),
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tool_id:** `str` — ID of the requested tool.
+
+
+
+
+
+-
+
+**request:** `ToolRequestModel`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.conversational_ai.tools.get_dependent_agents(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a list of agents depending on this tool
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from elevenlabs import ElevenLabs
+
+client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+)
+client.conversational_ai.tools.get_dependent_agents(
+ tool_id="tool_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tool_id:** `str` — ID of the requested tool.
+
+
+
+
+
+-
+
+**cursor:** `typing.Optional[str]` — Used for fetching next page. Cursor is returned in the response.
+
+
+
+
+
+-
+
+**page_size:** `typing.Optional[int]` — How many documents to return at maximum. Can not exceed 100, defaults to 30.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
diff --git a/src/elevenlabs/__init__.py b/src/elevenlabs/__init__.py
index 6d358f18..6c3cde73 100644
--- a/src/elevenlabs/__init__.py
+++ b/src/elevenlabs/__init__.py
@@ -80,7 +80,8 @@
BodyStreamChapterAudioV1ProjectsProjectIdChaptersChapterIdSnapshotsChapterSnapshotIdStreamPost,
BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost,
BreakdownTypes,
- BuiltInTools,
+ BuiltInToolsInput,
+ BuiltInToolsOutput,
ChapterContentBlockExtendableNodeResponseModel,
ChapterContentBlockInputModel,
ChapterContentBlockInputModelSubType,
@@ -112,9 +113,9 @@
ConvAiDynamicVariable,
ConvAiSecretLocator,
ConvAiStoredSecretDependencies,
- ConvAiStoredSecretDependenciesAgentToolsItem,
- ConvAiStoredSecretDependenciesAgentToolsItem_Available,
- ConvAiStoredSecretDependenciesAgentToolsItem_Unknown,
+ ConvAiStoredSecretDependenciesAgentsItem,
+ ConvAiStoredSecretDependenciesAgentsItem_Available,
+ ConvAiStoredSecretDependenciesAgentsItem_Unknown,
ConvAiStoredSecretDependenciesToolsItem,
ConvAiStoredSecretDependenciesToolsItem_Available,
ConvAiStoredSecretDependenciesToolsItem_Unknown,
@@ -192,6 +193,7 @@
DashboardCriteriaChartModel,
DashboardDataCollectionChartModel,
DataCollectionResultCommonModel,
+ DefaultSharingPreferencesResponseModel,
DeleteChapterRequest,
DeleteChapterResponseModel,
DeleteDubbingResponseModel,
@@ -206,13 +208,10 @@
DeleteWorkspaceMemberResponseModel,
DependentAvailableAgentIdentifier,
DependentAvailableAgentIdentifierAccessLevel,
- DependentAvailableAgentToolIdentifier,
- DependentAvailableAgentToolIdentifierAccessLevel,
DependentAvailableToolIdentifier,
DependentAvailableToolIdentifierAccessLevel,
DependentPhoneNumberIdentifier,
DependentUnknownAgentIdentifier,
- DependentUnknownAgentToolIdentifier,
DependentUnknownToolIdentifier,
DialogueInput,
DialogueInputResponseModel,
@@ -320,6 +319,10 @@
GetPronunciationDictionaryMetadataResponseModelPermissionOnResource,
GetPronunciationDictionaryResponse,
GetSpeechHistoryResponse,
+ GetToolDependentAgentsResponseModel,
+ GetToolDependentAgentsResponseModelAgentsItem,
+ GetToolDependentAgentsResponseModelAgentsItem_Available,
+ GetToolDependentAgentsResponseModelAgentsItem_Unknown,
GetVoicesResponse,
GetVoicesV2Response,
GetWorkspaceSecretsResponseModel,
@@ -432,24 +435,21 @@
ProjectSnapshotsResponse,
ProjectState,
PromptAgent,
+ PromptAgentApiModelInput,
+ PromptAgentApiModelInputToolsItem,
+ PromptAgentApiModelInputToolsItem_Client,
+ PromptAgentApiModelInputToolsItem_Mcp,
+ PromptAgentApiModelInputToolsItem_System,
+ PromptAgentApiModelInputToolsItem_Webhook,
+ PromptAgentApiModelOutput,
+ PromptAgentApiModelOutputToolsItem,
+ PromptAgentApiModelOutputToolsItem_Client,
+ PromptAgentApiModelOutputToolsItem_Mcp,
+ PromptAgentApiModelOutputToolsItem_System,
+ PromptAgentApiModelOutputToolsItem_Webhook,
+ PromptAgentApiModelOverride,
+ PromptAgentApiModelOverrideConfig,
PromptAgentDbModel,
- PromptAgentDbModelToolsItem,
- PromptAgentDbModelToolsItem_Client,
- PromptAgentDbModelToolsItem_Mcp,
- PromptAgentDbModelToolsItem_System,
- PromptAgentDbModelToolsItem_Webhook,
- PromptAgentInputToolsItem,
- PromptAgentInputToolsItem_Client,
- PromptAgentInputToolsItem_Mcp,
- PromptAgentInputToolsItem_System,
- PromptAgentInputToolsItem_Webhook,
- PromptAgentOutputToolsItem,
- PromptAgentOutputToolsItem_Client,
- PromptAgentOutputToolsItem_Mcp,
- PromptAgentOutputToolsItem_System,
- PromptAgentOutputToolsItem_Webhook,
- PromptAgentOverride,
- PromptAgentOverrideConfig,
PromptEvaluationCriteria,
PronunciationDictionaryAliasRuleRequestModel,
PronunciationDictionaryLocator,
@@ -556,6 +556,19 @@
Tool,
ToolAnnotations,
ToolMockConfig,
+ ToolRequestModel,
+ ToolRequestModelToolConfig,
+ ToolRequestModelToolConfig_Client,
+ ToolRequestModelToolConfig_Mcp,
+ ToolRequestModelToolConfig_System,
+ ToolRequestModelToolConfig_Webhook,
+ ToolResponseModel,
+ ToolResponseModelToolConfig,
+ ToolResponseModelToolConfig_Client,
+ ToolResponseModelToolConfig_Mcp,
+ ToolResponseModelToolConfig_System,
+ ToolResponseModelToolConfig_Webhook,
+ ToolsResponseModel,
TransferToAgentToolConfig,
TransferToNumberToolConfig,
TtsConversationalConfigInput,
@@ -638,6 +651,8 @@
WidgetTextContents,
WorkspaceBatchCallsResponse,
WorkspaceGroupByNameResponseModel,
+ WorkspaceGroupPermission,
+ WorkspaceGroupResponseModel,
WorkspaceResourceType,
WorkspaceWebhookListResponseModel,
WorkspaceWebhookResponseModel,
@@ -712,7 +727,11 @@
TextToSpeechStreamRequestOutputFormat,
TextToSpeechStreamWithTimestampsRequestOutputFormat,
)
-from .text_to_voice import TextToVoiceCreatePreviewsRequestOutputFormat
+from .text_to_voice import (
+ TextToVoiceCreatePreviewsRequestOutputFormat,
+ TextToVoiceDesignRequestOutputFormat,
+ VoiceDesignRequestModelModelId,
+)
from .v_1_text_to_speech_voice_id_multi_stream_input import ReceiveMessageMulti, SendMessageMulti
from .v_1_text_to_speech_voice_id_stream_input import ReceiveMessage, SendMessage
from .version import __version__
@@ -817,7 +836,8 @@
"BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization",
"BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization",
"BreakdownTypes",
- "BuiltInTools",
+ "BuiltInToolsInput",
+ "BuiltInToolsOutput",
"ChapterContentBlockExtendableNodeResponseModel",
"ChapterContentBlockInputModel",
"ChapterContentBlockInputModelSubType",
@@ -849,9 +869,9 @@
"ConvAiDynamicVariable",
"ConvAiSecretLocator",
"ConvAiStoredSecretDependencies",
- "ConvAiStoredSecretDependenciesAgentToolsItem",
- "ConvAiStoredSecretDependenciesAgentToolsItem_Available",
- "ConvAiStoredSecretDependenciesAgentToolsItem_Unknown",
+ "ConvAiStoredSecretDependenciesAgentsItem",
+ "ConvAiStoredSecretDependenciesAgentsItem_Available",
+ "ConvAiStoredSecretDependenciesAgentsItem_Unknown",
"ConvAiStoredSecretDependenciesToolsItem",
"ConvAiStoredSecretDependenciesToolsItem_Available",
"ConvAiStoredSecretDependenciesToolsItem_Unknown",
@@ -929,6 +949,7 @@
"DashboardCriteriaChartModel",
"DashboardDataCollectionChartModel",
"DataCollectionResultCommonModel",
+ "DefaultSharingPreferencesResponseModel",
"DeleteChapterRequest",
"DeleteChapterResponseModel",
"DeleteDubbingResponseModel",
@@ -943,13 +964,10 @@
"DeleteWorkspaceMemberResponseModel",
"DependentAvailableAgentIdentifier",
"DependentAvailableAgentIdentifierAccessLevel",
- "DependentAvailableAgentToolIdentifier",
- "DependentAvailableAgentToolIdentifierAccessLevel",
"DependentAvailableToolIdentifier",
"DependentAvailableToolIdentifierAccessLevel",
"DependentPhoneNumberIdentifier",
"DependentUnknownAgentIdentifier",
- "DependentUnknownAgentToolIdentifier",
"DependentUnknownToolIdentifier",
"DialogueInput",
"DialogueInputResponseModel",
@@ -1060,6 +1078,10 @@
"GetPronunciationDictionaryMetadataResponseModelPermissionOnResource",
"GetPronunciationDictionaryResponse",
"GetSpeechHistoryResponse",
+ "GetToolDependentAgentsResponseModel",
+ "GetToolDependentAgentsResponseModelAgentsItem",
+ "GetToolDependentAgentsResponseModelAgentsItem_Available",
+ "GetToolDependentAgentsResponseModelAgentsItem_Unknown",
"GetVoicesResponse",
"GetVoicesV2Response",
"GetWorkspaceSecretsResponseModel",
@@ -1174,24 +1196,21 @@
"ProjectSnapshotsResponse",
"ProjectState",
"PromptAgent",
+ "PromptAgentApiModelInput",
+ "PromptAgentApiModelInputToolsItem",
+ "PromptAgentApiModelInputToolsItem_Client",
+ "PromptAgentApiModelInputToolsItem_Mcp",
+ "PromptAgentApiModelInputToolsItem_System",
+ "PromptAgentApiModelInputToolsItem_Webhook",
+ "PromptAgentApiModelOutput",
+ "PromptAgentApiModelOutputToolsItem",
+ "PromptAgentApiModelOutputToolsItem_Client",
+ "PromptAgentApiModelOutputToolsItem_Mcp",
+ "PromptAgentApiModelOutputToolsItem_System",
+ "PromptAgentApiModelOutputToolsItem_Webhook",
+ "PromptAgentApiModelOverride",
+ "PromptAgentApiModelOverrideConfig",
"PromptAgentDbModel",
- "PromptAgentDbModelToolsItem",
- "PromptAgentDbModelToolsItem_Client",
- "PromptAgentDbModelToolsItem_Mcp",
- "PromptAgentDbModelToolsItem_System",
- "PromptAgentDbModelToolsItem_Webhook",
- "PromptAgentInputToolsItem",
- "PromptAgentInputToolsItem_Client",
- "PromptAgentInputToolsItem_Mcp",
- "PromptAgentInputToolsItem_System",
- "PromptAgentInputToolsItem_Webhook",
- "PromptAgentOutputToolsItem",
- "PromptAgentOutputToolsItem_Client",
- "PromptAgentOutputToolsItem_Mcp",
- "PromptAgentOutputToolsItem_System",
- "PromptAgentOutputToolsItem_Webhook",
- "PromptAgentOverride",
- "PromptAgentOverrideConfig",
"PromptEvaluationCriteria",
"PronunciationDictionariesCreateFromFileRequestWorkspaceAccess",
"PronunciationDictionariesListRequestSort",
@@ -1315,10 +1334,24 @@
"TextToSpeechStreamRequestOutputFormat",
"TextToSpeechStreamWithTimestampsRequestOutputFormat",
"TextToVoiceCreatePreviewsRequestOutputFormat",
+ "TextToVoiceDesignRequestOutputFormat",
"TooEarlyError",
"Tool",
"ToolAnnotations",
"ToolMockConfig",
+ "ToolRequestModel",
+ "ToolRequestModelToolConfig",
+ "ToolRequestModelToolConfig_Client",
+ "ToolRequestModelToolConfig_Mcp",
+ "ToolRequestModelToolConfig_System",
+ "ToolRequestModelToolConfig_Webhook",
+ "ToolResponseModel",
+ "ToolResponseModelToolConfig",
+ "ToolResponseModelToolConfig_Client",
+ "ToolResponseModelToolConfig_Mcp",
+ "ToolResponseModelToolConfig_System",
+ "ToolResponseModelToolConfig_Webhook",
+ "ToolsResponseModel",
"TransferToAgentToolConfig",
"TransferToNumberToolConfig",
"TtsConversationalConfigInput",
@@ -1353,6 +1386,7 @@
"VerifyPvcVoiceCaptchaResponseModel",
"Voice",
"VoiceDesignPreviewResponse",
+ "VoiceDesignRequestModelModelId",
"VoiceGenerationParameterOptionResponse",
"VoiceGenerationParameterResponse",
"VoicePreviewResponseModel",
@@ -1403,6 +1437,8 @@
"WidgetTextContents",
"WorkspaceBatchCallsResponse",
"WorkspaceGroupByNameResponseModel",
+ "WorkspaceGroupPermission",
+ "WorkspaceGroupResponseModel",
"WorkspaceResourceType",
"WorkspaceWebhookListResponseModel",
"WorkspaceWebhookResponseModel",
diff --git a/src/elevenlabs/conversational_ai/__init__.py b/src/elevenlabs/conversational_ai/__init__.py
index 7e29d4ce..269bd240 100644
--- a/src/elevenlabs/conversational_ai/__init__.py
+++ b/src/elevenlabs/conversational_ai/__init__.py
@@ -14,6 +14,7 @@
secrets,
settings,
sip_trunk,
+ tools,
twilio,
)
from .phone_numbers import (
@@ -55,5 +56,6 @@
"secrets",
"settings",
"sip_trunk",
+ "tools",
"twilio",
]
diff --git a/src/elevenlabs/conversational_ai/agents/client.py b/src/elevenlabs/conversational_ai/agents/client.py
index 05c14030..e780e956 100644
--- a/src/elevenlabs/conversational_ai/agents/client.py
+++ b/src/elevenlabs/conversational_ai/agents/client.py
@@ -262,6 +262,46 @@ def list(
)
return _response.data
+ def duplicate(
+ self,
+ agent_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CreateAgentResponseModel:
+ """
+ Create a new agent by duplicating an existing one
+
+ Parameters
+ ----------
+ agent_id : str
+ The id of an agent. This is returned on agent creation.
+
+ name : typing.Optional[str]
+ A name to make the agent easier to find
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CreateAgentResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.agents.duplicate(
+ agent_id="21m00Tcm4TlvDq8ikWAM",
+ )
+ """
+ _response = self._raw_client.duplicate(agent_id, name=name, request_options=request_options)
+ return _response.data
+
def simulate_conversation(
self,
agent_id: str,
@@ -662,6 +702,54 @@ async def main() -> None:
)
return _response.data
+ async def duplicate(
+ self,
+ agent_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CreateAgentResponseModel:
+ """
+ Create a new agent by duplicating an existing one
+
+ Parameters
+ ----------
+ agent_id : str
+ The id of an agent. This is returned on agent creation.
+
+ name : typing.Optional[str]
+ A name to make the agent easier to find
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CreateAgentResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.agents.duplicate(
+ agent_id="21m00Tcm4TlvDq8ikWAM",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.duplicate(agent_id, name=name, request_options=request_options)
+ return _response.data
+
async def simulate_conversation(
self,
agent_id: str,
diff --git a/src/elevenlabs/conversational_ai/agents/raw_client.py b/src/elevenlabs/conversational_ai/agents/raw_client.py
index 5e84140d..cba2d420 100644
--- a/src/elevenlabs/conversational_ai/agents/raw_client.py
+++ b/src/elevenlabs/conversational_ai/agents/raw_client.py
@@ -352,6 +352,71 @@ def list(
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 duplicate(
+ self,
+ agent_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[CreateAgentResponseModel]:
+ """
+ Create a new agent by duplicating an existing one
+
+ Parameters
+ ----------
+ agent_id : str
+ The id of an agent. This is returned on agent creation.
+
+ name : typing.Optional[str]
+ A name to make the agent easier to find
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[CreateAgentResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/duplicate",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json={
+ "name": name,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ CreateAgentResponseModel,
+ construct_type(
+ type_=CreateAgentResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 simulate_conversation(
self,
agent_id: str,
@@ -826,6 +891,71 @@ async def list(
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 duplicate(
+ self,
+ agent_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[CreateAgentResponseModel]:
+ """
+ Create a new agent by duplicating an existing one
+
+ Parameters
+ ----------
+ agent_id : str
+ The id of an agent. This is returned on agent creation.
+
+ name : typing.Optional[str]
+ A name to make the agent easier to find
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[CreateAgentResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/duplicate",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json={
+ "name": name,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ CreateAgentResponseModel,
+ construct_type(
+ type_=CreateAgentResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 simulate_conversation(
self,
agent_id: str,
diff --git a/src/elevenlabs/conversational_ai/client.py b/src/elevenlabs/conversational_ai/client.py
index e87f210d..a4a2d363 100644
--- a/src/elevenlabs/conversational_ai/client.py
+++ b/src/elevenlabs/conversational_ai/client.py
@@ -22,6 +22,7 @@
from .secrets.client import AsyncSecretsClient, SecretsClient
from .settings.client import AsyncSettingsClient, SettingsClient
from .sip_trunk.client import AsyncSipTrunkClient, SipTrunkClient
+from .tools.client import AsyncToolsClient, ToolsClient
from .twilio.client import AsyncTwilioClient, TwilioClient
# this is used as the default value for optional parameters
@@ -43,6 +44,8 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
self.knowledge_base = KnowledgeBaseClient(client_wrapper=client_wrapper)
+ self.tools = ToolsClient(client_wrapper=client_wrapper)
+
self.settings = SettingsClient(client_wrapper=client_wrapper)
self.secrets = SecretsClient(client_wrapper=client_wrapper)
@@ -264,6 +267,8 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
self.knowledge_base = AsyncKnowledgeBaseClient(client_wrapper=client_wrapper)
+ self.tools = AsyncToolsClient(client_wrapper=client_wrapper)
+
self.settings = AsyncSettingsClient(client_wrapper=client_wrapper)
self.secrets = AsyncSecretsClient(client_wrapper=client_wrapper)
diff --git a/src/elevenlabs/conversational_ai/tools/__init__.py b/src/elevenlabs/conversational_ai/tools/__init__.py
new file mode 100644
index 00000000..5cde0202
--- /dev/null
+++ b/src/elevenlabs/conversational_ai/tools/__init__.py
@@ -0,0 +1,4 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# isort: skip_file
+
diff --git a/src/elevenlabs/conversational_ai/tools/client.py b/src/elevenlabs/conversational_ai/tools/client.py
new file mode 100644
index 00000000..4cff2d39
--- /dev/null
+++ b/src/elevenlabs/conversational_ai/tools/client.py
@@ -0,0 +1,542 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.get_tool_dependent_agents_response_model import GetToolDependentAgentsResponseModel
+from ...types.tool_request_model import ToolRequestModel
+from ...types.tool_response_model import ToolResponseModel
+from ...types.tools_response_model import ToolsResponseModel
+from .raw_client import AsyncRawToolsClient, RawToolsClient
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ToolsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._raw_client = RawToolsClient(client_wrapper=client_wrapper)
+
+ @property
+ def with_raw_response(self) -> RawToolsClient:
+ """
+ Retrieves a raw implementation of this client that returns raw responses.
+
+ Returns
+ -------
+ RawToolsClient
+ """
+ return self._raw_client
+
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ToolsResponseModel:
+ """
+ Get all available tools available in the workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolsResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.tools.list()
+ """
+ _response = self._raw_client.list(request_options=request_options)
+ return _response.data
+
+ def create(
+ self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> ToolResponseModel:
+ """
+ Add a new tool to the available tools in the workspace.
+
+ Parameters
+ ----------
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import (
+ ElevenLabs,
+ ToolRequestModel,
+ ToolRequestModelToolConfig_Client,
+ )
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.tools.create(
+ request=ToolRequestModel(
+ tool_config=ToolRequestModelToolConfig_Client(
+ name="name",
+ description="description",
+ expects_response=False,
+ ),
+ ),
+ )
+ """
+ _response = self._raw_client.create(request=request, request_options=request_options)
+ return _response.data
+
+ def get(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ToolResponseModel:
+ """
+ Get tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.tools.get(
+ tool_id="tool_id",
+ )
+ """
+ _response = self._raw_client.get(tool_id, request_options=request_options)
+ return _response.data
+
+ def delete(
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Optional[typing.Any]:
+ """
+ Delete tool from the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.Optional[typing.Any]
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.tools.delete(
+ tool_id="tool_id",
+ )
+ """
+ _response = self._raw_client.delete(tool_id, request_options=request_options)
+ return _response.data
+
+ def update(
+ self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> ToolResponseModel:
+ """
+ Update tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import (
+ ElevenLabs,
+ ToolRequestModel,
+ ToolRequestModelToolConfig_Client,
+ )
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.tools.update(
+ tool_id="tool_id",
+ request=ToolRequestModel(
+ tool_config=ToolRequestModelToolConfig_Client(
+ name="name",
+ description="description",
+ expects_response=False,
+ ),
+ ),
+ )
+ """
+ _response = self._raw_client.update(tool_id, request=request, request_options=request_options)
+ return _response.data
+
+ def get_dependent_agents(
+ self,
+ tool_id: str,
+ *,
+ cursor: typing.Optional[str] = None,
+ page_size: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> GetToolDependentAgentsResponseModel:
+ """
+ Get a list of agents depending on this tool
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ cursor : typing.Optional[str]
+ Used for fetching next page. Cursor is returned in the response.
+
+ page_size : typing.Optional[int]
+ How many documents to return at maximum. Can not exceed 100, defaults to 30.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetToolDependentAgentsResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.conversational_ai.tools.get_dependent_agents(
+ tool_id="tool_id",
+ )
+ """
+ _response = self._raw_client.get_dependent_agents(
+ tool_id, cursor=cursor, page_size=page_size, request_options=request_options
+ )
+ return _response.data
+
+
+class AsyncToolsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper)
+
+ @property
+ def with_raw_response(self) -> AsyncRawToolsClient:
+ """
+ Retrieves a raw implementation of this client that returns raw responses.
+
+ Returns
+ -------
+ AsyncRawToolsClient
+ """
+ return self._raw_client
+
+ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ToolsResponseModel:
+ """
+ Get all available tools available in the workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolsResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.tools.list()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.list(request_options=request_options)
+ return _response.data
+
+ async def create(
+ self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> ToolResponseModel:
+ """
+ Add a new tool to the available tools in the workspace.
+
+ Parameters
+ ----------
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import (
+ AsyncElevenLabs,
+ ToolRequestModel,
+ ToolRequestModelToolConfig_Client,
+ )
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.tools.create(
+ request=ToolRequestModel(
+ tool_config=ToolRequestModelToolConfig_Client(
+ name="name",
+ description="description",
+ expects_response=False,
+ ),
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.create(request=request, request_options=request_options)
+ return _response.data
+
+ async def get(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ToolResponseModel:
+ """
+ Get tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.tools.get(
+ tool_id="tool_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.get(tool_id, request_options=request_options)
+ return _response.data
+
+ async def delete(
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Optional[typing.Any]:
+ """
+ Delete tool from the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.Optional[typing.Any]
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.tools.delete(
+ tool_id="tool_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.delete(tool_id, request_options=request_options)
+ return _response.data
+
+ async def update(
+ self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> ToolResponseModel:
+ """
+ Update tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ToolResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import (
+ AsyncElevenLabs,
+ ToolRequestModel,
+ ToolRequestModelToolConfig_Client,
+ )
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.tools.update(
+ tool_id="tool_id",
+ request=ToolRequestModel(
+ tool_config=ToolRequestModelToolConfig_Client(
+ name="name",
+ description="description",
+ expects_response=False,
+ ),
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.update(tool_id, request=request, request_options=request_options)
+ return _response.data
+
+ async def get_dependent_agents(
+ self,
+ tool_id: str,
+ *,
+ cursor: typing.Optional[str] = None,
+ page_size: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> GetToolDependentAgentsResponseModel:
+ """
+ Get a list of agents depending on this tool
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ cursor : typing.Optional[str]
+ Used for fetching next page. Cursor is returned in the response.
+
+ page_size : typing.Optional[int]
+ How many documents to return at maximum. Can not exceed 100, defaults to 30.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetToolDependentAgentsResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.conversational_ai.tools.get_dependent_agents(
+ tool_id="tool_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.get_dependent_agents(
+ tool_id, cursor=cursor, page_size=page_size, request_options=request_options
+ )
+ return _response.data
diff --git a/src/elevenlabs/conversational_ai/tools/raw_client.py b/src/elevenlabs/conversational_ai/tools/raw_client.py
new file mode 100644
index 00000000..f3c542c2
--- /dev/null
+++ b/src/elevenlabs/conversational_ai/tools/raw_client.py
@@ -0,0 +1,699 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from json.decoder import JSONDecodeError
+
+from ...core.api_error import ApiError
+from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
+from ...core.http_response import AsyncHttpResponse, HttpResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.request_options import RequestOptions
+from ...core.serialization import convert_and_respect_annotation_metadata
+from ...core.unchecked_base_model import construct_type
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.get_tool_dependent_agents_response_model import GetToolDependentAgentsResponseModel
+from ...types.http_validation_error import HttpValidationError
+from ...types.tool_request_model import ToolRequestModel
+from ...types.tool_response_model import ToolResponseModel
+from ...types.tools_response_model import ToolsResponseModel
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class RawToolsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[ToolsResponseModel]:
+ """
+ Get all available tools available in the workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[ToolsResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/convai/tools",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolsResponseModel,
+ construct_type(
+ type_=ToolsResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 create(
+ self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[ToolResponseModel]:
+ """
+ Add a new tool to the available tools in the workspace.
+
+ Parameters
+ ----------
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[ToolResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/convai/tools",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ToolRequestModel, direction="write"
+ ),
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolResponseModel,
+ construct_type(
+ type_=ToolResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 get(
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[ToolResponseModel]:
+ """
+ Get tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[ToolResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolResponseModel,
+ construct_type(
+ type_=ToolResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 delete(
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
+ """
+ Delete tool from the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[typing.Optional[typing.Any]]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}",
+ base_url=self._client_wrapper.get_environment().base,
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if _response is None or not _response.text.strip():
+ return HttpResponse(response=_response, data=None)
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ typing.Optional[typing.Any],
+ construct_type(
+ type_=typing.Optional[typing.Any], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 update(
+ self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[ToolResponseModel]:
+ """
+ Update tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[ToolResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}",
+ base_url=self._client_wrapper.get_environment().base,
+ method="PATCH",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ToolRequestModel, direction="write"
+ ),
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolResponseModel,
+ construct_type(
+ type_=ToolResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 get_dependent_agents(
+ self,
+ tool_id: str,
+ *,
+ cursor: typing.Optional[str] = None,
+ page_size: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[GetToolDependentAgentsResponseModel]:
+ """
+ Get a list of agents depending on this tool
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ cursor : typing.Optional[str]
+ Used for fetching next page. Cursor is returned in the response.
+
+ page_size : typing.Optional[int]
+ How many documents to return at maximum. Can not exceed 100, defaults to 30.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[GetToolDependentAgentsResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}/dependent-agents",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ params={
+ "cursor": cursor,
+ "page_size": page_size,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetToolDependentAgentsResponseModel,
+ construct_type(
+ type_=GetToolDependentAgentsResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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)
+
+
+class AsyncRawToolsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def list(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[ToolsResponseModel]:
+ """
+ Get all available tools available in the workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[ToolsResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/convai/tools",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolsResponseModel,
+ construct_type(
+ type_=ToolsResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 create(
+ self, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[ToolResponseModel]:
+ """
+ Add a new tool to the available tools in the workspace.
+
+ Parameters
+ ----------
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[ToolResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/convai/tools",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ToolRequestModel, direction="write"
+ ),
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolResponseModel,
+ construct_type(
+ type_=ToolResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 get(
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[ToolResponseModel]:
+ """
+ Get tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[ToolResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolResponseModel,
+ construct_type(
+ type_=ToolResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 delete(
+ self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
+ """
+ Delete tool from the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[typing.Optional[typing.Any]]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}",
+ base_url=self._client_wrapper.get_environment().base,
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if _response is None or not _response.text.strip():
+ return AsyncHttpResponse(response=_response, data=None)
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ typing.Optional[typing.Any],
+ construct_type(
+ type_=typing.Optional[typing.Any], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 update(
+ self, tool_id: str, *, request: ToolRequestModel, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[ToolResponseModel]:
+ """
+ Update tool that is available in the workspace.
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ request : ToolRequestModel
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[ToolResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}",
+ base_url=self._client_wrapper.get_environment().base,
+ method="PATCH",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ToolRequestModel, direction="write"
+ ),
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ ToolResponseModel,
+ construct_type(
+ type_=ToolResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 get_dependent_agents(
+ self,
+ tool_id: str,
+ *,
+ cursor: typing.Optional[str] = None,
+ page_size: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[GetToolDependentAgentsResponseModel]:
+ """
+ Get a list of agents depending on this tool
+
+ Parameters
+ ----------
+ tool_id : str
+ ID of the requested tool.
+
+ cursor : typing.Optional[str]
+ Used for fetching next page. Cursor is returned in the response.
+
+ page_size : typing.Optional[int]
+ How many documents to return at maximum. Can not exceed 100, defaults to 30.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[GetToolDependentAgentsResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"v1/convai/tools/{jsonable_encoder(tool_id)}/dependent-agents",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ params={
+ "cursor": cursor,
+ "page_size": page_size,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ GetToolDependentAgentsResponseModel,
+ construct_type(
+ type_=GetToolDependentAgentsResponseModel, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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)
diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py
index 24bbfe41..65ded672 100644
--- a/src/elevenlabs/core/client_wrapper.py
+++ b/src/elevenlabs/core/client_wrapper.py
@@ -21,10 +21,10 @@ def __init__(
def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
- "User-Agent": "elevenlabs/v2.4.0",
+ "User-Agent": "elevenlabs/v2.5.0",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "elevenlabs",
- "X-Fern-SDK-Version": "v2.4.0",
+ "X-Fern-SDK-Version": "v2.5.0",
}
if self._api_key is not None:
headers["xi-api-key"] = self._api_key
diff --git a/src/elevenlabs/dubbing/client.py b/src/elevenlabs/dubbing/client.py
index 380739c6..4b20cc27 100644
--- a/src/elevenlabs/dubbing/client.py
+++ b/src/elevenlabs/dubbing/client.py
@@ -58,6 +58,7 @@ def create(
dubbing_studio: typing.Optional[bool] = OMIT,
disable_voice_cloning: typing.Optional[bool] = OMIT,
mode: typing.Optional[str] = OMIT,
+ csv_fps: typing.Optional[float] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> DoDubbingResponse:
"""
@@ -119,6 +120,9 @@ def create(
mode : typing.Optional[str]
automatic or manual. Manual mode is only supported when creating a dubbing studio project
+ csv_fps : typing.Optional[float]
+ Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -155,6 +159,7 @@ def create(
dubbing_studio=dubbing_studio,
disable_voice_cloning=disable_voice_cloning,
mode=mode,
+ csv_fps=csv_fps,
request_options=request_options,
)
return _response.data
@@ -267,6 +272,7 @@ async def create(
dubbing_studio: typing.Optional[bool] = OMIT,
disable_voice_cloning: typing.Optional[bool] = OMIT,
mode: typing.Optional[str] = OMIT,
+ csv_fps: typing.Optional[float] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> DoDubbingResponse:
"""
@@ -328,6 +334,9 @@ async def create(
mode : typing.Optional[str]
automatic or manual. Manual mode is only supported when creating a dubbing studio project
+ csv_fps : typing.Optional[float]
+ Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -372,6 +381,7 @@ async def main() -> None:
dubbing_studio=dubbing_studio,
disable_voice_cloning=disable_voice_cloning,
mode=mode,
+ csv_fps=csv_fps,
request_options=request_options,
)
return _response.data
diff --git a/src/elevenlabs/dubbing/raw_client.py b/src/elevenlabs/dubbing/raw_client.py
index e8f09118..351584c7 100644
--- a/src/elevenlabs/dubbing/raw_client.py
+++ b/src/elevenlabs/dubbing/raw_client.py
@@ -45,6 +45,7 @@ def create(
dubbing_studio: typing.Optional[bool] = OMIT,
disable_voice_cloning: typing.Optional[bool] = OMIT,
mode: typing.Optional[str] = OMIT,
+ csv_fps: typing.Optional[float] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[DoDubbingResponse]:
"""
@@ -106,6 +107,9 @@ def create(
mode : typing.Optional[str]
automatic or manual. Manual mode is only supported when creating a dubbing studio project
+ csv_fps : typing.Optional[float]
+ Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -133,6 +137,7 @@ def create(
"dubbing_studio": dubbing_studio,
"disable_voice_cloning": disable_voice_cloning,
"mode": mode,
+ "csv_fps": csv_fps,
},
files={
**({"file": file} if file is not None else {}),
@@ -298,6 +303,7 @@ async def create(
dubbing_studio: typing.Optional[bool] = OMIT,
disable_voice_cloning: typing.Optional[bool] = OMIT,
mode: typing.Optional[str] = OMIT,
+ csv_fps: typing.Optional[float] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[DoDubbingResponse]:
"""
@@ -359,6 +365,9 @@ async def create(
mode : typing.Optional[str]
automatic or manual. Manual mode is only supported when creating a dubbing studio project
+ csv_fps : typing.Optional[float]
+ Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.
+
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
@@ -386,6 +395,7 @@ async def create(
"dubbing_studio": dubbing_studio,
"disable_voice_cloning": disable_voice_cloning,
"mode": mode,
+ "csv_fps": csv_fps,
},
files={
**({"file": file} if file is not None else {}),
diff --git a/src/elevenlabs/text_to_voice/__init__.py b/src/elevenlabs/text_to_voice/__init__.py
index de76103f..1fed45dc 100644
--- a/src/elevenlabs/text_to_voice/__init__.py
+++ b/src/elevenlabs/text_to_voice/__init__.py
@@ -2,6 +2,14 @@
# isort: skip_file
-from .types import TextToVoiceCreatePreviewsRequestOutputFormat
+from .types import (
+ TextToVoiceCreatePreviewsRequestOutputFormat,
+ TextToVoiceDesignRequestOutputFormat,
+ VoiceDesignRequestModelModelId,
+)
-__all__ = ["TextToVoiceCreatePreviewsRequestOutputFormat"]
+__all__ = [
+ "TextToVoiceCreatePreviewsRequestOutputFormat",
+ "TextToVoiceDesignRequestOutputFormat",
+ "VoiceDesignRequestModelModelId",
+]
diff --git a/src/elevenlabs/text_to_voice/client.py b/src/elevenlabs/text_to_voice/client.py
index 77ab3b78..2efa5de7 100644
--- a/src/elevenlabs/text_to_voice/client.py
+++ b/src/elevenlabs/text_to_voice/client.py
@@ -8,6 +8,8 @@
from ..types.voice_design_preview_response import VoiceDesignPreviewResponse
from .raw_client import AsyncRawTextToVoiceClient, RawTextToVoiceClient
from .types.text_to_voice_create_previews_request_output_format import TextToVoiceCreatePreviewsRequestOutputFormat
+from .types.text_to_voice_design_request_output_format import TextToVoiceDesignRequestOutputFormat
+from .types.voice_design_request_model_model_id import VoiceDesignRequestModelModelId
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
@@ -163,6 +165,156 @@ def create_voice_from_preview(
)
return _response.data
+ def create(
+ self,
+ *,
+ voice_name: str,
+ voice_description: str,
+ generated_voice_id: str,
+ labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
+ played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> Voice:
+ """
+ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix.
+
+ Parameters
+ ----------
+ voice_name : str
+ Name to use for the created voice.
+
+ voice_description : str
+ Description to use for the created voice.
+
+ generated_voice_id : str
+ The generated_voice_id to create, call POST /v1/text-to-voice/create-previews and fetch the generated_voice_id from the response header if don't have one yet.
+
+ labels : typing.Optional[typing.Dict[str, typing.Optional[str]]]
+ Optional, metadata to add to the created voice. Defaults to None.
+
+ played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]]
+ List of voice ids that the user has played but not selected. Used for RLHF.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Voice
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.text_to_voice.create(
+ voice_name="Sassy squeaky mouse",
+ voice_description="A sassy squeaky mouse",
+ generated_voice_id="37HceQefKmEi3bGovXjL",
+ )
+ """
+ _response = self._raw_client.create(
+ voice_name=voice_name,
+ voice_description=voice_description,
+ generated_voice_id=generated_voice_id,
+ labels=labels,
+ played_not_selected_voice_ids=played_not_selected_voice_ids,
+ request_options=request_options,
+ )
+ return _response.data
+
+ def design(
+ self,
+ *,
+ voice_description: str,
+ output_format: typing.Optional[TextToVoiceDesignRequestOutputFormat] = None,
+ model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT,
+ text: typing.Optional[str] = OMIT,
+ auto_generate_text: typing.Optional[bool] = OMIT,
+ loudness: typing.Optional[float] = OMIT,
+ seed: typing.Optional[int] = OMIT,
+ guidance_scale: typing.Optional[float] = OMIT,
+ quality: typing.Optional[float] = OMIT,
+ reference_audio_base_64: typing.Optional[str] = OMIT,
+ prompt_strength: typing.Optional[float] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VoiceDesignPreviewResponse:
+ """
+ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
+
+ Parameters
+ ----------
+ voice_description : str
+ Description to use for the created voice.
+
+ output_format : typing.Optional[TextToVoiceDesignRequestOutputFormat]
+ Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
+
+ model_id : typing.Optional[VoiceDesignRequestModelModelId]
+ Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.
+
+ text : typing.Optional[str]
+ Text to generate, text length has to be between 100 and 1000.
+
+ auto_generate_text : typing.Optional[bool]
+ Whether to automatically generate a text suitable for the voice description.
+
+ loudness : typing.Optional[float]
+ Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
+
+ seed : typing.Optional[int]
+ Random number that controls the voice generation. Same seed with same inputs produces same voice.
+
+ guidance_scale : typing.Optional[float]
+ Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
+
+ quality : typing.Optional[float]
+ Higher quality results in better voice output but less variety.
+
+ reference_audio_base_64 : typing.Optional[str]
+ Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.
+
+ prompt_strength : typing.Optional[float]
+ Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VoiceDesignPreviewResponse
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.text_to_voice.design(
+ voice_description="A sassy squeaky mouse",
+ )
+ """
+ _response = self._raw_client.design(
+ voice_description=voice_description,
+ output_format=output_format,
+ model_id=model_id,
+ text=text,
+ auto_generate_text=auto_generate_text,
+ loudness=loudness,
+ seed=seed,
+ guidance_scale=guidance_scale,
+ quality=quality,
+ reference_audio_base_64=reference_audio_base_64,
+ prompt_strength=prompt_strength,
+ request_options=request_options,
+ )
+ return _response.data
+
class AsyncTextToVoiceClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -329,3 +481,169 @@ async def main() -> None:
request_options=request_options,
)
return _response.data
+
+ async def create(
+ self,
+ *,
+ voice_name: str,
+ voice_description: str,
+ generated_voice_id: str,
+ labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
+ played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> Voice:
+ """
+ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix.
+
+ Parameters
+ ----------
+ voice_name : str
+ Name to use for the created voice.
+
+ voice_description : str
+ Description to use for the created voice.
+
+ generated_voice_id : str
+ The generated_voice_id to create, call POST /v1/text-to-voice/create-previews and fetch the generated_voice_id from the response header if don't have one yet.
+
+ labels : typing.Optional[typing.Dict[str, typing.Optional[str]]]
+ Optional, metadata to add to the created voice. Defaults to None.
+
+ played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]]
+ List of voice ids that the user has played but not selected. Used for RLHF.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Voice
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.text_to_voice.create(
+ voice_name="Sassy squeaky mouse",
+ voice_description="A sassy squeaky mouse",
+ generated_voice_id="37HceQefKmEi3bGovXjL",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.create(
+ voice_name=voice_name,
+ voice_description=voice_description,
+ generated_voice_id=generated_voice_id,
+ labels=labels,
+ played_not_selected_voice_ids=played_not_selected_voice_ids,
+ request_options=request_options,
+ )
+ return _response.data
+
+ async def design(
+ self,
+ *,
+ voice_description: str,
+ output_format: typing.Optional[TextToVoiceDesignRequestOutputFormat] = None,
+ model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT,
+ text: typing.Optional[str] = OMIT,
+ auto_generate_text: typing.Optional[bool] = OMIT,
+ loudness: typing.Optional[float] = OMIT,
+ seed: typing.Optional[int] = OMIT,
+ guidance_scale: typing.Optional[float] = OMIT,
+ quality: typing.Optional[float] = OMIT,
+ reference_audio_base_64: typing.Optional[str] = OMIT,
+ prompt_strength: typing.Optional[float] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VoiceDesignPreviewResponse:
+ """
+ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
+
+ Parameters
+ ----------
+ voice_description : str
+ Description to use for the created voice.
+
+ output_format : typing.Optional[TextToVoiceDesignRequestOutputFormat]
+ Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
+
+ model_id : typing.Optional[VoiceDesignRequestModelModelId]
+ Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.
+
+ text : typing.Optional[str]
+ Text to generate, text length has to be between 100 and 1000.
+
+ auto_generate_text : typing.Optional[bool]
+ Whether to automatically generate a text suitable for the voice description.
+
+ loudness : typing.Optional[float]
+ Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
+
+ seed : typing.Optional[int]
+ Random number that controls the voice generation. Same seed with same inputs produces same voice.
+
+ guidance_scale : typing.Optional[float]
+ Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
+
+ quality : typing.Optional[float]
+ Higher quality results in better voice output but less variety.
+
+ reference_audio_base_64 : typing.Optional[str]
+ Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.
+
+ prompt_strength : typing.Optional[float]
+ Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VoiceDesignPreviewResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.text_to_voice.design(
+ voice_description="A sassy squeaky mouse",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.design(
+ voice_description=voice_description,
+ output_format=output_format,
+ model_id=model_id,
+ text=text,
+ auto_generate_text=auto_generate_text,
+ loudness=loudness,
+ seed=seed,
+ guidance_scale=guidance_scale,
+ quality=quality,
+ reference_audio_base_64=reference_audio_base_64,
+ prompt_strength=prompt_strength,
+ request_options=request_options,
+ )
+ return _response.data
diff --git a/src/elevenlabs/text_to_voice/raw_client.py b/src/elevenlabs/text_to_voice/raw_client.py
index 27a43154..45492ad5 100644
--- a/src/elevenlabs/text_to_voice/raw_client.py
+++ b/src/elevenlabs/text_to_voice/raw_client.py
@@ -13,6 +13,8 @@
from ..types.voice import Voice
from ..types.voice_design_preview_response import VoiceDesignPreviewResponse
from .types.text_to_voice_create_previews_request_output_format import TextToVoiceCreatePreviewsRequestOutputFormat
+from .types.text_to_voice_design_request_output_format import TextToVoiceDesignRequestOutputFormat
+from .types.voice_design_request_model_model_id import VoiceDesignRequestModelModelId
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
@@ -201,6 +203,200 @@ def create_voice_from_preview(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+ def create(
+ self,
+ *,
+ voice_name: str,
+ voice_description: str,
+ generated_voice_id: str,
+ labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
+ played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[Voice]:
+ """
+ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix.
+
+ Parameters
+ ----------
+ voice_name : str
+ Name to use for the created voice.
+
+ voice_description : str
+ Description to use for the created voice.
+
+ generated_voice_id : str
+ The generated_voice_id to create, call POST /v1/text-to-voice/create-previews and fetch the generated_voice_id from the response header if don't have one yet.
+
+ labels : typing.Optional[typing.Dict[str, typing.Optional[str]]]
+ Optional, metadata to add to the created voice. Defaults to None.
+
+ played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]]
+ List of voice ids that the user has played but not selected. Used for RLHF.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[Voice]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/text-to-voice",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json={
+ "voice_name": voice_name,
+ "voice_description": voice_description,
+ "generated_voice_id": generated_voice_id,
+ "labels": labels,
+ "played_not_selected_voice_ids": played_not_selected_voice_ids,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ Voice,
+ construct_type(
+ type_=Voice, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 design(
+ self,
+ *,
+ voice_description: str,
+ output_format: typing.Optional[TextToVoiceDesignRequestOutputFormat] = None,
+ model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT,
+ text: typing.Optional[str] = OMIT,
+ auto_generate_text: typing.Optional[bool] = OMIT,
+ loudness: typing.Optional[float] = OMIT,
+ seed: typing.Optional[int] = OMIT,
+ guidance_scale: typing.Optional[float] = OMIT,
+ quality: typing.Optional[float] = OMIT,
+ reference_audio_base_64: typing.Optional[str] = OMIT,
+ prompt_strength: typing.Optional[float] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> HttpResponse[VoiceDesignPreviewResponse]:
+ """
+ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
+
+ Parameters
+ ----------
+ voice_description : str
+ Description to use for the created voice.
+
+ output_format : typing.Optional[TextToVoiceDesignRequestOutputFormat]
+ Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
+
+ model_id : typing.Optional[VoiceDesignRequestModelModelId]
+ Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.
+
+ text : typing.Optional[str]
+ Text to generate, text length has to be between 100 and 1000.
+
+ auto_generate_text : typing.Optional[bool]
+ Whether to automatically generate a text suitable for the voice description.
+
+ loudness : typing.Optional[float]
+ Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
+
+ seed : typing.Optional[int]
+ Random number that controls the voice generation. Same seed with same inputs produces same voice.
+
+ guidance_scale : typing.Optional[float]
+ Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
+
+ quality : typing.Optional[float]
+ Higher quality results in better voice output but less variety.
+
+ reference_audio_base_64 : typing.Optional[str]
+ Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.
+
+ prompt_strength : typing.Optional[float]
+ Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[VoiceDesignPreviewResponse]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/text-to-voice/design",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ params={
+ "output_format": output_format,
+ },
+ json={
+ "voice_description": voice_description,
+ "model_id": model_id,
+ "text": text,
+ "auto_generate_text": auto_generate_text,
+ "loudness": loudness,
+ "seed": seed,
+ "guidance_scale": guidance_scale,
+ "quality": quality,
+ "reference_audio_base64": reference_audio_base_64,
+ "prompt_strength": prompt_strength,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ VoiceDesignPreviewResponse,
+ construct_type(
+ type_=VoiceDesignPreviewResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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)
+
class AsyncRawTextToVoiceClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -384,3 +580,197 @@ async def create_voice_from_preview(
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+
+ async def create(
+ self,
+ *,
+ voice_name: str,
+ voice_description: str,
+ generated_voice_id: str,
+ labels: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
+ played_not_selected_voice_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[Voice]:
+ """
+ Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or POST /v1/text-to-voice/:voice_id/remix.
+
+ Parameters
+ ----------
+ voice_name : str
+ Name to use for the created voice.
+
+ voice_description : str
+ Description to use for the created voice.
+
+ generated_voice_id : str
+ The generated_voice_id to create, call POST /v1/text-to-voice/create-previews and fetch the generated_voice_id from the response header if don't have one yet.
+
+ labels : typing.Optional[typing.Dict[str, typing.Optional[str]]]
+ Optional, metadata to add to the created voice. Defaults to None.
+
+ played_not_selected_voice_ids : typing.Optional[typing.Sequence[str]]
+ List of voice ids that the user has played but not selected. Used for RLHF.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[Voice]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/text-to-voice",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json={
+ "voice_name": voice_name,
+ "voice_description": voice_description,
+ "generated_voice_id": generated_voice_id,
+ "labels": labels,
+ "played_not_selected_voice_ids": played_not_selected_voice_ids,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ Voice,
+ construct_type(
+ type_=Voice, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 design(
+ self,
+ *,
+ voice_description: str,
+ output_format: typing.Optional[TextToVoiceDesignRequestOutputFormat] = None,
+ model_id: typing.Optional[VoiceDesignRequestModelModelId] = OMIT,
+ text: typing.Optional[str] = OMIT,
+ auto_generate_text: typing.Optional[bool] = OMIT,
+ loudness: typing.Optional[float] = OMIT,
+ seed: typing.Optional[int] = OMIT,
+ guidance_scale: typing.Optional[float] = OMIT,
+ quality: typing.Optional[float] = OMIT,
+ reference_audio_base_64: typing.Optional[str] = OMIT,
+ prompt_strength: typing.Optional[float] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AsyncHttpResponse[VoiceDesignPreviewResponse]:
+ """
+ Design a voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
+
+ Parameters
+ ----------
+ voice_description : str
+ Description to use for the created voice.
+
+ output_format : typing.Optional[TextToVoiceDesignRequestOutputFormat]
+ Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
+
+ model_id : typing.Optional[VoiceDesignRequestModelModelId]
+ Model to use for the voice generation. Possible values: eleven_multilingual_ttv_v2, eleven_ttv_v3.
+
+ text : typing.Optional[str]
+ Text to generate, text length has to be between 100 and 1000.
+
+ auto_generate_text : typing.Optional[bool]
+ Whether to automatically generate a text suitable for the voice description.
+
+ loudness : typing.Optional[float]
+ Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS.
+
+ seed : typing.Optional[int]
+ Random number that controls the voice generation. Same seed with same inputs produces same voice.
+
+ guidance_scale : typing.Optional[float]
+ Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale.
+
+ quality : typing.Optional[float]
+ Higher quality results in better voice output but less variety.
+
+ reference_audio_base_64 : typing.Optional[str]
+ Reference audio to use for the voice generation. The audio should be base64 encoded. Only supported when using the eleven_ttv_v3 model.
+
+ prompt_strength : typing.Optional[float]
+ Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[VoiceDesignPreviewResponse]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/text-to-voice/design",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ params={
+ "output_format": output_format,
+ },
+ json={
+ "voice_description": voice_description,
+ "model_id": model_id,
+ "text": text,
+ "auto_generate_text": auto_generate_text,
+ "loudness": loudness,
+ "seed": seed,
+ "guidance_scale": guidance_scale,
+ "quality": quality,
+ "reference_audio_base64": reference_audio_base_64,
+ "prompt_strength": prompt_strength,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ VoiceDesignPreviewResponse,
+ construct_type(
+ type_=VoiceDesignPreviewResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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)
diff --git a/src/elevenlabs/text_to_voice/types/__init__.py b/src/elevenlabs/text_to_voice/types/__init__.py
index 16e08ef3..9ca24f20 100644
--- a/src/elevenlabs/text_to_voice/types/__init__.py
+++ b/src/elevenlabs/text_to_voice/types/__init__.py
@@ -3,5 +3,11 @@
# isort: skip_file
from .text_to_voice_create_previews_request_output_format import TextToVoiceCreatePreviewsRequestOutputFormat
+from .text_to_voice_design_request_output_format import TextToVoiceDesignRequestOutputFormat
+from .voice_design_request_model_model_id import VoiceDesignRequestModelModelId
-__all__ = ["TextToVoiceCreatePreviewsRequestOutputFormat"]
+__all__ = [
+ "TextToVoiceCreatePreviewsRequestOutputFormat",
+ "TextToVoiceDesignRequestOutputFormat",
+ "VoiceDesignRequestModelModelId",
+]
diff --git a/src/elevenlabs/text_to_voice/types/text_to_voice_design_request_output_format.py b/src/elevenlabs/text_to_voice/types/text_to_voice_design_request_output_format.py
new file mode 100644
index 00000000..0842f36c
--- /dev/null
+++ b/src/elevenlabs/text_to_voice/types/text_to_voice_design_request_output_format.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+TextToVoiceDesignRequestOutputFormat = typing.Union[
+ typing.Literal[
+ "mp3_22050_32",
+ "mp3_44100_32",
+ "mp3_44100_64",
+ "mp3_44100_96",
+ "mp3_44100_128",
+ "mp3_44100_192",
+ "pcm_8000",
+ "pcm_16000",
+ "pcm_22050",
+ "pcm_24000",
+ "pcm_44100",
+ "pcm_48000",
+ "ulaw_8000",
+ "alaw_8000",
+ "opus_48000_32",
+ "opus_48000_64",
+ "opus_48000_96",
+ "opus_48000_128",
+ "opus_48000_192",
+ ],
+ typing.Any,
+]
diff --git a/src/elevenlabs/text_to_voice/types/voice_design_request_model_model_id.py b/src/elevenlabs/text_to_voice/types/voice_design_request_model_model_id.py
new file mode 100644
index 00000000..d0202881
--- /dev/null
+++ b/src/elevenlabs/text_to_voice/types/voice_design_request_model_model_id.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VoiceDesignRequestModelModelId = typing.Union[typing.Literal["eleven_multilingual_ttv_v2", "eleven_ttv_v3"], typing.Any]
diff --git a/src/elevenlabs/types/__init__.py b/src/elevenlabs/types/__init__.py
index bf77d282..1a159b81 100644
--- a/src/elevenlabs/types/__init__.py
+++ b/src/elevenlabs/types/__init__.py
@@ -113,7 +113,8 @@
BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost,
)
from .breakdown_types import BreakdownTypes
-from .built_in_tools import BuiltInTools
+from .built_in_tools_input import BuiltInToolsInput
+from .built_in_tools_output import BuiltInToolsOutput
from .chapter_content_block_extendable_node_response_model import ChapterContentBlockExtendableNodeResponseModel
from .chapter_content_block_input_model import ChapterContentBlockInputModel
from .chapter_content_block_input_model_sub_type import ChapterContentBlockInputModelSubType
@@ -147,10 +148,10 @@
from .conv_ai_dynamic_variable import ConvAiDynamicVariable
from .conv_ai_secret_locator import ConvAiSecretLocator
from .conv_ai_stored_secret_dependencies import ConvAiStoredSecretDependencies
-from .conv_ai_stored_secret_dependencies_agent_tools_item import (
- ConvAiStoredSecretDependenciesAgentToolsItem,
- ConvAiStoredSecretDependenciesAgentToolsItem_Available,
- ConvAiStoredSecretDependenciesAgentToolsItem_Unknown,
+from .conv_ai_stored_secret_dependencies_agents_item import (
+ ConvAiStoredSecretDependenciesAgentsItem,
+ ConvAiStoredSecretDependenciesAgentsItem_Available,
+ ConvAiStoredSecretDependenciesAgentsItem_Unknown,
)
from .conv_ai_stored_secret_dependencies_tools_item import (
ConvAiStoredSecretDependenciesToolsItem,
@@ -255,6 +256,7 @@
from .dashboard_criteria_chart_model import DashboardCriteriaChartModel
from .dashboard_data_collection_chart_model import DashboardDataCollectionChartModel
from .data_collection_result_common_model import DataCollectionResultCommonModel
+from .default_sharing_preferences_response_model import DefaultSharingPreferencesResponseModel
from .delete_chapter_request import DeleteChapterRequest
from .delete_chapter_response_model import DeleteChapterResponseModel
from .delete_dubbing_response_model import DeleteDubbingResponseModel
@@ -269,13 +271,10 @@
from .delete_workspace_member_response_model import DeleteWorkspaceMemberResponseModel
from .dependent_available_agent_identifier import DependentAvailableAgentIdentifier
from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel
-from .dependent_available_agent_tool_identifier import DependentAvailableAgentToolIdentifier
-from .dependent_available_agent_tool_identifier_access_level import DependentAvailableAgentToolIdentifierAccessLevel
from .dependent_available_tool_identifier import DependentAvailableToolIdentifier
from .dependent_available_tool_identifier_access_level import DependentAvailableToolIdentifierAccessLevel
from .dependent_phone_number_identifier import DependentPhoneNumberIdentifier
from .dependent_unknown_agent_identifier import DependentUnknownAgentIdentifier
-from .dependent_unknown_agent_tool_identifier import DependentUnknownAgentToolIdentifier
from .dependent_unknown_tool_identifier import DependentUnknownToolIdentifier
from .dialogue_input import DialogueInput
from .dialogue_input_response_model import DialogueInputResponseModel
@@ -405,6 +404,12 @@
)
from .get_pronunciation_dictionary_response import GetPronunciationDictionaryResponse
from .get_speech_history_response import GetSpeechHistoryResponse
+from .get_tool_dependent_agents_response_model import GetToolDependentAgentsResponseModel
+from .get_tool_dependent_agents_response_model_agents_item import (
+ GetToolDependentAgentsResponseModelAgentsItem,
+ GetToolDependentAgentsResponseModelAgentsItem_Available,
+ GetToolDependentAgentsResponseModelAgentsItem_Unknown,
+)
from .get_voices_response import GetVoicesResponse
from .get_voices_v_2_response import GetVoicesV2Response
from .get_workspace_secrets_response_model import GetWorkspaceSecretsResponseModel
@@ -519,30 +524,25 @@
from .project_snapshots_response import ProjectSnapshotsResponse
from .project_state import ProjectState
from .prompt_agent import PromptAgent
-from .prompt_agent_db_model import PromptAgentDbModel
-from .prompt_agent_db_model_tools_item import (
- PromptAgentDbModelToolsItem,
- PromptAgentDbModelToolsItem_Client,
- PromptAgentDbModelToolsItem_Mcp,
- PromptAgentDbModelToolsItem_System,
- PromptAgentDbModelToolsItem_Webhook,
-)
-from .prompt_agent_input_tools_item import (
- PromptAgentInputToolsItem,
- PromptAgentInputToolsItem_Client,
- PromptAgentInputToolsItem_Mcp,
- PromptAgentInputToolsItem_System,
- PromptAgentInputToolsItem_Webhook,
+from .prompt_agent_api_model_input import PromptAgentApiModelInput
+from .prompt_agent_api_model_input_tools_item import (
+ PromptAgentApiModelInputToolsItem,
+ PromptAgentApiModelInputToolsItem_Client,
+ PromptAgentApiModelInputToolsItem_Mcp,
+ PromptAgentApiModelInputToolsItem_System,
+ PromptAgentApiModelInputToolsItem_Webhook,
)
-from .prompt_agent_output_tools_item import (
- PromptAgentOutputToolsItem,
- PromptAgentOutputToolsItem_Client,
- PromptAgentOutputToolsItem_Mcp,
- PromptAgentOutputToolsItem_System,
- PromptAgentOutputToolsItem_Webhook,
+from .prompt_agent_api_model_output import PromptAgentApiModelOutput
+from .prompt_agent_api_model_output_tools_item import (
+ PromptAgentApiModelOutputToolsItem,
+ PromptAgentApiModelOutputToolsItem_Client,
+ PromptAgentApiModelOutputToolsItem_Mcp,
+ PromptAgentApiModelOutputToolsItem_System,
+ PromptAgentApiModelOutputToolsItem_Webhook,
)
-from .prompt_agent_override import PromptAgentOverride
-from .prompt_agent_override_config import PromptAgentOverrideConfig
+from .prompt_agent_api_model_override import PromptAgentApiModelOverride
+from .prompt_agent_api_model_override_config import PromptAgentApiModelOverrideConfig
+from .prompt_agent_db_model import PromptAgentDbModel
from .prompt_evaluation_criteria import PromptEvaluationCriteria
from .pronunciation_dictionary_alias_rule_request_model import PronunciationDictionaryAliasRuleRequestModel
from .pronunciation_dictionary_locator import PronunciationDictionaryLocator
@@ -655,6 +655,23 @@
from .tool import Tool
from .tool_annotations import ToolAnnotations
from .tool_mock_config import ToolMockConfig
+from .tool_request_model import ToolRequestModel
+from .tool_request_model_tool_config import (
+ ToolRequestModelToolConfig,
+ ToolRequestModelToolConfig_Client,
+ ToolRequestModelToolConfig_Mcp,
+ ToolRequestModelToolConfig_System,
+ ToolRequestModelToolConfig_Webhook,
+)
+from .tool_response_model import ToolResponseModel
+from .tool_response_model_tool_config import (
+ ToolResponseModelToolConfig,
+ ToolResponseModelToolConfig_Client,
+ ToolResponseModelToolConfig_Mcp,
+ ToolResponseModelToolConfig_System,
+ ToolResponseModelToolConfig_Webhook,
+)
+from .tools_response_model import ToolsResponseModel
from .transfer_to_agent_tool_config import TransferToAgentToolConfig
from .transfer_to_number_tool_config import TransferToNumberToolConfig
from .tts_conversational_config_input import TtsConversationalConfigInput
@@ -747,6 +764,8 @@
from .widget_text_contents import WidgetTextContents
from .workspace_batch_calls_response import WorkspaceBatchCallsResponse
from .workspace_group_by_name_response_model import WorkspaceGroupByNameResponseModel
+from .workspace_group_permission import WorkspaceGroupPermission
+from .workspace_group_response_model import WorkspaceGroupResponseModel
from .workspace_resource_type import WorkspaceResourceType
from .workspace_webhook_list_response_model import WorkspaceWebhookListResponseModel
from .workspace_webhook_response_model import WorkspaceWebhookResponseModel
@@ -830,7 +849,8 @@
"BodyStreamChapterAudioV1ProjectsProjectIdChaptersChapterIdSnapshotsChapterSnapshotIdStreamPost",
"BodyStreamProjectAudioV1ProjectsProjectIdSnapshotsProjectSnapshotIdStreamPost",
"BreakdownTypes",
- "BuiltInTools",
+ "BuiltInToolsInput",
+ "BuiltInToolsOutput",
"ChapterContentBlockExtendableNodeResponseModel",
"ChapterContentBlockInputModel",
"ChapterContentBlockInputModelSubType",
@@ -862,9 +882,9 @@
"ConvAiDynamicVariable",
"ConvAiSecretLocator",
"ConvAiStoredSecretDependencies",
- "ConvAiStoredSecretDependenciesAgentToolsItem",
- "ConvAiStoredSecretDependenciesAgentToolsItem_Available",
- "ConvAiStoredSecretDependenciesAgentToolsItem_Unknown",
+ "ConvAiStoredSecretDependenciesAgentsItem",
+ "ConvAiStoredSecretDependenciesAgentsItem_Available",
+ "ConvAiStoredSecretDependenciesAgentsItem_Unknown",
"ConvAiStoredSecretDependenciesToolsItem",
"ConvAiStoredSecretDependenciesToolsItem_Available",
"ConvAiStoredSecretDependenciesToolsItem_Unknown",
@@ -942,6 +962,7 @@
"DashboardCriteriaChartModel",
"DashboardDataCollectionChartModel",
"DataCollectionResultCommonModel",
+ "DefaultSharingPreferencesResponseModel",
"DeleteChapterRequest",
"DeleteChapterResponseModel",
"DeleteDubbingResponseModel",
@@ -956,13 +977,10 @@
"DeleteWorkspaceMemberResponseModel",
"DependentAvailableAgentIdentifier",
"DependentAvailableAgentIdentifierAccessLevel",
- "DependentAvailableAgentToolIdentifier",
- "DependentAvailableAgentToolIdentifierAccessLevel",
"DependentAvailableToolIdentifier",
"DependentAvailableToolIdentifierAccessLevel",
"DependentPhoneNumberIdentifier",
"DependentUnknownAgentIdentifier",
- "DependentUnknownAgentToolIdentifier",
"DependentUnknownToolIdentifier",
"DialogueInput",
"DialogueInputResponseModel",
@@ -1070,6 +1088,10 @@
"GetPronunciationDictionaryMetadataResponseModelPermissionOnResource",
"GetPronunciationDictionaryResponse",
"GetSpeechHistoryResponse",
+ "GetToolDependentAgentsResponseModel",
+ "GetToolDependentAgentsResponseModelAgentsItem",
+ "GetToolDependentAgentsResponseModelAgentsItem_Available",
+ "GetToolDependentAgentsResponseModelAgentsItem_Unknown",
"GetVoicesResponse",
"GetVoicesV2Response",
"GetWorkspaceSecretsResponseModel",
@@ -1182,24 +1204,21 @@
"ProjectSnapshotsResponse",
"ProjectState",
"PromptAgent",
+ "PromptAgentApiModelInput",
+ "PromptAgentApiModelInputToolsItem",
+ "PromptAgentApiModelInputToolsItem_Client",
+ "PromptAgentApiModelInputToolsItem_Mcp",
+ "PromptAgentApiModelInputToolsItem_System",
+ "PromptAgentApiModelInputToolsItem_Webhook",
+ "PromptAgentApiModelOutput",
+ "PromptAgentApiModelOutputToolsItem",
+ "PromptAgentApiModelOutputToolsItem_Client",
+ "PromptAgentApiModelOutputToolsItem_Mcp",
+ "PromptAgentApiModelOutputToolsItem_System",
+ "PromptAgentApiModelOutputToolsItem_Webhook",
+ "PromptAgentApiModelOverride",
+ "PromptAgentApiModelOverrideConfig",
"PromptAgentDbModel",
- "PromptAgentDbModelToolsItem",
- "PromptAgentDbModelToolsItem_Client",
- "PromptAgentDbModelToolsItem_Mcp",
- "PromptAgentDbModelToolsItem_System",
- "PromptAgentDbModelToolsItem_Webhook",
- "PromptAgentInputToolsItem",
- "PromptAgentInputToolsItem_Client",
- "PromptAgentInputToolsItem_Mcp",
- "PromptAgentInputToolsItem_System",
- "PromptAgentInputToolsItem_Webhook",
- "PromptAgentOutputToolsItem",
- "PromptAgentOutputToolsItem_Client",
- "PromptAgentOutputToolsItem_Mcp",
- "PromptAgentOutputToolsItem_System",
- "PromptAgentOutputToolsItem_Webhook",
- "PromptAgentOverride",
- "PromptAgentOverrideConfig",
"PromptEvaluationCriteria",
"PronunciationDictionaryAliasRuleRequestModel",
"PronunciationDictionaryLocator",
@@ -1306,6 +1325,19 @@
"Tool",
"ToolAnnotations",
"ToolMockConfig",
+ "ToolRequestModel",
+ "ToolRequestModelToolConfig",
+ "ToolRequestModelToolConfig_Client",
+ "ToolRequestModelToolConfig_Mcp",
+ "ToolRequestModelToolConfig_System",
+ "ToolRequestModelToolConfig_Webhook",
+ "ToolResponseModel",
+ "ToolResponseModelToolConfig",
+ "ToolResponseModelToolConfig_Client",
+ "ToolResponseModelToolConfig_Mcp",
+ "ToolResponseModelToolConfig_System",
+ "ToolResponseModelToolConfig_Webhook",
+ "ToolsResponseModel",
"TransferToAgentToolConfig",
"TransferToNumberToolConfig",
"TtsConversationalConfigInput",
@@ -1388,6 +1420,8 @@
"WidgetTextContents",
"WorkspaceBatchCallsResponse",
"WorkspaceGroupByNameResponseModel",
+ "WorkspaceGroupPermission",
+ "WorkspaceGroupResponseModel",
"WorkspaceResourceType",
"WorkspaceWebhookListResponseModel",
"WorkspaceWebhookResponseModel",
diff --git a/src/elevenlabs/types/agent_config.py b/src/elevenlabs/types/agent_config.py
index cfbc6afe..b0c75513 100644
--- a/src/elevenlabs/types/agent_config.py
+++ b/src/elevenlabs/types/agent_config.py
@@ -1,11 +1,9 @@
# This file was auto-generated by Fern from our API Definition.
-from __future__ import annotations
-
import typing
import pydantic
-from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .dynamic_variables_config import DynamicVariablesConfig
from .prompt_agent_db_model import PromptAgentDbModel
@@ -37,9 +35,3 @@ class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
-
-
-from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
-from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-
-update_forward_refs(AgentConfig)
diff --git a/src/elevenlabs/types/agent_config_override.py b/src/elevenlabs/types/agent_config_override.py
index d7478edf..9a917987 100644
--- a/src/elevenlabs/types/agent_config_override.py
+++ b/src/elevenlabs/types/agent_config_override.py
@@ -5,7 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
-from .prompt_agent_override import PromptAgentOverride
+from .prompt_agent_api_model_override import PromptAgentApiModelOverride
class AgentConfigOverride(UncheckedBaseModel):
@@ -19,7 +19,7 @@ class AgentConfigOverride(UncheckedBaseModel):
Language of the agent - used for ASR and TTS
"""
- prompt: typing.Optional[PromptAgentOverride] = pydantic.Field(default=None)
+ prompt: typing.Optional[PromptAgentApiModelOverride] = pydantic.Field(default=None)
"""
The prompt for the agent
"""
diff --git a/src/elevenlabs/types/agent_config_override_config.py b/src/elevenlabs/types/agent_config_override_config.py
index e19fe1a4..0e3a3dee 100644
--- a/src/elevenlabs/types/agent_config_override_config.py
+++ b/src/elevenlabs/types/agent_config_override_config.py
@@ -5,7 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
-from .prompt_agent_override_config import PromptAgentOverrideConfig
+from .prompt_agent_api_model_override_config import PromptAgentApiModelOverrideConfig
class AgentConfigOverrideConfig(UncheckedBaseModel):
@@ -19,7 +19,7 @@ class AgentConfigOverrideConfig(UncheckedBaseModel):
Whether to allow overriding the language field.
"""
- prompt: typing.Optional[PromptAgentOverrideConfig] = pydantic.Field(default=None)
+ prompt: typing.Optional[PromptAgentApiModelOverrideConfig] = pydantic.Field(default=None)
"""
Configures overrides for nested fields.
"""
diff --git a/src/elevenlabs/types/asr_provider.py b/src/elevenlabs/types/asr_provider.py
index af99d4a7..96137fe0 100644
--- a/src/elevenlabs/types/asr_provider.py
+++ b/src/elevenlabs/types/asr_provider.py
@@ -2,4 +2,4 @@
import typing
-AsrProvider = typing.Literal["elevenlabs"]
+AsrProvider = typing.Union[typing.Literal["elevenlabs", "realtime_scribe_v1"], typing.Any]
diff --git a/src/elevenlabs/types/built_in_tools.py b/src/elevenlabs/types/built_in_tools_input.py
similarity index 96%
rename from src/elevenlabs/types/built_in_tools.py
rename to src/elevenlabs/types/built_in_tools_input.py
index b5623d99..a9929a33 100644
--- a/src/elevenlabs/types/built_in_tools.py
+++ b/src/elevenlabs/types/built_in_tools_input.py
@@ -8,7 +8,7 @@
from .system_tool_config_input import SystemToolConfigInput
-class BuiltInTools(UncheckedBaseModel):
+class BuiltInToolsInput(UncheckedBaseModel):
end_call: typing.Optional[SystemToolConfigInput] = pydantic.Field(default=None)
"""
The end call tool
diff --git a/src/elevenlabs/types/built_in_tools_output.py b/src/elevenlabs/types/built_in_tools_output.py
new file mode 100644
index 00000000..d5d688e7
--- /dev/null
+++ b/src/elevenlabs/types/built_in_tools_output.py
@@ -0,0 +1,44 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+from ..core.unchecked_base_model import UncheckedBaseModel
+from .system_tool_config_output import SystemToolConfigOutput
+
+
+class BuiltInToolsOutput(UncheckedBaseModel):
+ end_call: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None)
+ """
+ The end call tool
+ """
+
+ language_detection: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None)
+ """
+ The language detection tool
+ """
+
+ transfer_to_agent: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None)
+ """
+ The transfer to agent tool
+ """
+
+ transfer_to_number: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None)
+ """
+ The transfer to number tool
+ """
+
+ skip_turn: typing.Optional[SystemToolConfigOutput] = pydantic.Field(default=None)
+ """
+ The skip turn tool
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[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_tool_config_input.py b/src/elevenlabs/types/client_tool_config_input.py
index 96a650d0..4c5ac7d6 100644
--- a/src/elevenlabs/types/client_tool_config_input.py
+++ b/src/elevenlabs/types/client_tool_config_input.py
@@ -15,7 +15,6 @@ class ClientToolConfigInput(UncheckedBaseModel):
A client tool is one that sends an event to the user's client to trigger something client side
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/client_tool_config_output.py b/src/elevenlabs/types/client_tool_config_output.py
index 557f64cd..09171960 100644
--- a/src/elevenlabs/types/client_tool_config_output.py
+++ b/src/elevenlabs/types/client_tool_config_output.py
@@ -15,7 +15,6 @@ class ClientToolConfigOutput(UncheckedBaseModel):
A client tool is one that sends an event to the user's client to trigger something client side
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/conv_ai_stored_secret_dependencies.py b/src/elevenlabs/types/conv_ai_stored_secret_dependencies.py
index b488c175..bd6dc7c8 100644
--- a/src/elevenlabs/types/conv_ai_stored_secret_dependencies.py
+++ b/src/elevenlabs/types/conv_ai_stored_secret_dependencies.py
@@ -5,7 +5,7 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
-from .conv_ai_stored_secret_dependencies_agent_tools_item import ConvAiStoredSecretDependenciesAgentToolsItem
+from .conv_ai_stored_secret_dependencies_agents_item import ConvAiStoredSecretDependenciesAgentsItem
from .conv_ai_stored_secret_dependencies_tools_item import ConvAiStoredSecretDependenciesToolsItem
from .dependent_phone_number_identifier import DependentPhoneNumberIdentifier
from .secret_dependency_type import SecretDependencyType
@@ -13,7 +13,7 @@
class ConvAiStoredSecretDependencies(UncheckedBaseModel):
tools: typing.List[ConvAiStoredSecretDependenciesToolsItem]
- agent_tools: typing.List[ConvAiStoredSecretDependenciesAgentToolsItem]
+ agents: typing.List[ConvAiStoredSecretDependenciesAgentsItem]
others: typing.List[SecretDependencyType]
phone_numbers: typing.Optional[typing.List[DependentPhoneNumberIdentifier]] = None
diff --git a/src/elevenlabs/types/conv_ai_stored_secret_dependencies_agents_item.py b/src/elevenlabs/types/conv_ai_stored_secret_dependencies_agents_item.py
new file mode 100644
index 00000000..ccb26654
--- /dev/null
+++ b/src/elevenlabs/types/conv_ai_stored_secret_dependencies_agents_item.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
+from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel
+
+
+class ConvAiStoredSecretDependenciesAgentsItem_Available(UncheckedBaseModel):
+ type: typing.Literal["available"] = "available"
+ id: str
+ name: str
+ created_at_unix_secs: int
+ access_level: DependentAvailableAgentIdentifierAccessLevel
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ConvAiStoredSecretDependenciesAgentsItem_Unknown(UncheckedBaseModel):
+ type: typing.Literal["unknown"] = "unknown"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+ConvAiStoredSecretDependenciesAgentsItem = typing_extensions.Annotated[
+ typing.Union[ConvAiStoredSecretDependenciesAgentsItem_Available, ConvAiStoredSecretDependenciesAgentsItem_Unknown],
+ UnionMetadata(discriminant="type"),
+]
diff --git a/src/elevenlabs/types/conversation_charging_common_model.py b/src/elevenlabs/types/conversation_charging_common_model.py
index 02d5bc17..368e484c 100644
--- a/src/elevenlabs/types/conversation_charging_common_model.py
+++ b/src/elevenlabs/types/conversation_charging_common_model.py
@@ -14,6 +14,8 @@ class ConversationChargingCommonModel(UncheckedBaseModel):
tier: typing.Optional[str] = None
llm_usage: typing.Optional[LlmCategoryUsage] = None
llm_price: typing.Optional[float] = None
+ llm_charge: typing.Optional[int] = None
+ call_charge: typing.Optional[int] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
diff --git a/src/elevenlabs/types/conversation_simulation_specification.py b/src/elevenlabs/types/conversation_simulation_specification.py
index da925bc2..97e90c99 100644
--- a/src/elevenlabs/types/conversation_simulation_specification.py
+++ b/src/elevenlabs/types/conversation_simulation_specification.py
@@ -1,11 +1,9 @@
# This file was auto-generated by Fern from our API Definition.
-from __future__ import annotations
-
import typing
import pydantic
-from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .agent_config import AgentConfig
from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput
@@ -41,9 +39,3 @@ class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
-
-
-from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
-from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-
-update_forward_refs(ConversationSimulationSpecification)
diff --git a/src/elevenlabs/types/conversational_config.py b/src/elevenlabs/types/conversational_config.py
index 5acf972a..39bb6aea 100644
--- a/src/elevenlabs/types/conversational_config.py
+++ b/src/elevenlabs/types/conversational_config.py
@@ -1,11 +1,9 @@
# This file was auto-generated by Fern from our API Definition.
-from __future__ import annotations
-
import typing
import pydantic
-from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .agent_config import AgentConfig
from .asr_conversational_config import AsrConversationalConfig
@@ -54,9 +52,3 @@ class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
-
-
-from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
-from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-
-update_forward_refs(ConversationalConfig)
diff --git a/src/elevenlabs/types/dependent_available_agent_tool_identifier.py b/src/elevenlabs/types/default_sharing_preferences_response_model.py
similarity index 59%
rename from src/elevenlabs/types/dependent_available_agent_tool_identifier.py
rename to src/elevenlabs/types/default_sharing_preferences_response_model.py
index 554741e2..c8206922 100644
--- a/src/elevenlabs/types/dependent_available_agent_tool_identifier.py
+++ b/src/elevenlabs/types/default_sharing_preferences_response_model.py
@@ -5,15 +5,14 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
-from .dependent_available_agent_tool_identifier_access_level import DependentAvailableAgentToolIdentifierAccessLevel
+from .workspace_group_response_model import WorkspaceGroupResponseModel
-class DependentAvailableAgentToolIdentifier(UncheckedBaseModel):
- agent_id: str
- agent_name: str
- used_by: typing.List[str]
- created_at_unix_secs: int
- access_level: DependentAvailableAgentToolIdentifierAccessLevel
+class DefaultSharingPreferencesResponseModel(UncheckedBaseModel):
+ default_sharing_groups: typing.List[WorkspaceGroupResponseModel] = pydantic.Field()
+ """
+ List of groups that the user shares with by default
+ """
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/dependent_available_agent_tool_identifier_access_level.py b/src/elevenlabs/types/dependent_available_agent_tool_identifier_access_level.py
deleted file mode 100644
index d2035273..00000000
--- a/src/elevenlabs/types/dependent_available_agent_tool_identifier_access_level.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file was auto-generated by Fern from our API Definition.
-
-import typing
-
-DependentAvailableAgentToolIdentifierAccessLevel = typing.Union[typing.Literal["admin", "editor", "viewer"], typing.Any]
diff --git a/src/elevenlabs/types/get_agent_response_model.py b/src/elevenlabs/types/get_agent_response_model.py
index eb8d13ec..c5075cb2 100644
--- a/src/elevenlabs/types/get_agent_response_model.py
+++ b/src/elevenlabs/types/get_agent_response_model.py
@@ -1,11 +1,9 @@
# This file was auto-generated by Fern from our API Definition.
-from __future__ import annotations
-
import typing
import pydantic
-from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .agent_metadata_response_model import AgentMetadataResponseModel
from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel
@@ -63,9 +61,3 @@ class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
-
-
-from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
-from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-
-update_forward_refs(GetAgentResponseModel)
diff --git a/src/elevenlabs/types/get_tool_dependent_agents_response_model.py b/src/elevenlabs/types/get_tool_dependent_agents_response_model.py
new file mode 100644
index 00000000..f2765217
--- /dev/null
+++ b/src/elevenlabs/types/get_tool_dependent_agents_response_model.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
+from .get_tool_dependent_agents_response_model_agents_item import GetToolDependentAgentsResponseModelAgentsItem
+
+
+class GetToolDependentAgentsResponseModel(UncheckedBaseModel):
+ agents: typing.List[GetToolDependentAgentsResponseModelAgentsItem]
+ next_cursor: typing.Optional[str] = None
+ has_more: bool
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/elevenlabs/types/conv_ai_stored_secret_dependencies_agent_tools_item.py b/src/elevenlabs/types/get_tool_dependent_agents_response_model_agents_item.py
similarity index 63%
rename from src/elevenlabs/types/conv_ai_stored_secret_dependencies_agent_tools_item.py
rename to src/elevenlabs/types/get_tool_dependent_agents_response_model_agents_item.py
index a6b369a7..f9e0cc8e 100644
--- a/src/elevenlabs/types/conv_ai_stored_secret_dependencies_agent_tools_item.py
+++ b/src/elevenlabs/types/get_tool_dependent_agents_response_model_agents_item.py
@@ -8,16 +8,15 @@
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
-from .dependent_available_agent_tool_identifier_access_level import DependentAvailableAgentToolIdentifierAccessLevel
+from .dependent_available_agent_identifier_access_level import DependentAvailableAgentIdentifierAccessLevel
-class ConvAiStoredSecretDependenciesAgentToolsItem_Available(UncheckedBaseModel):
+class GetToolDependentAgentsResponseModelAgentsItem_Available(UncheckedBaseModel):
type: typing.Literal["available"] = "available"
- agent_id: str
- agent_name: str
- used_by: typing.List[str]
+ id: str
+ name: str
created_at_unix_secs: int
- access_level: DependentAvailableAgentToolIdentifierAccessLevel
+ access_level: DependentAvailableAgentIdentifierAccessLevel
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -29,7 +28,7 @@ class Config:
extra = pydantic.Extra.allow
-class ConvAiStoredSecretDependenciesAgentToolsItem_Unknown(UncheckedBaseModel):
+class GetToolDependentAgentsResponseModelAgentsItem_Unknown(UncheckedBaseModel):
type: typing.Literal["unknown"] = "unknown"
if IS_PYDANTIC_V2:
@@ -42,9 +41,9 @@ class Config:
extra = pydantic.Extra.allow
-ConvAiStoredSecretDependenciesAgentToolsItem = typing_extensions.Annotated[
+GetToolDependentAgentsResponseModelAgentsItem = typing_extensions.Annotated[
typing.Union[
- ConvAiStoredSecretDependenciesAgentToolsItem_Available, ConvAiStoredSecretDependenciesAgentToolsItem_Unknown
+ GetToolDependentAgentsResponseModelAgentsItem_Available, GetToolDependentAgentsResponseModelAgentsItem_Unknown
],
UnionMetadata(discriminant="type"),
]
diff --git a/src/elevenlabs/types/mcp_tool_config_input.py b/src/elevenlabs/types/mcp_tool_config_input.py
index 5f5e8b24..b80335a6 100644
--- a/src/elevenlabs/types/mcp_tool_config_input.py
+++ b/src/elevenlabs/types/mcp_tool_config_input.py
@@ -16,7 +16,6 @@ class McpToolConfigInput(UncheckedBaseModel):
An MCP tool configuration that can be used to call MCP servers
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/mcp_tool_config_output.py b/src/elevenlabs/types/mcp_tool_config_output.py
index 4630f2eb..e13c1bc5 100644
--- a/src/elevenlabs/types/mcp_tool_config_output.py
+++ b/src/elevenlabs/types/mcp_tool_config_output.py
@@ -16,7 +16,6 @@ class McpToolConfigOutput(UncheckedBaseModel):
An MCP tool configuration that can be used to call MCP servers
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/prompt_agent.py b/src/elevenlabs/types/prompt_agent.py
index f31de1cd..6d3b60eb 100644
--- a/src/elevenlabs/types/prompt_agent.py
+++ b/src/elevenlabs/types/prompt_agent.py
@@ -1,91 +1,5 @@
# This file was auto-generated by Fern from our API Definition.
-from __future__ import annotations
-
import typing
-import pydantic
-from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
-from ..core.unchecked_base_model import UncheckedBaseModel
-from .custom_llm import CustomLlm
-from .knowledge_base_locator import KnowledgeBaseLocator
-from .llm import Llm
-from .prompt_agent_output_tools_item import PromptAgentOutputToolsItem
-from .rag_config import RagConfig
-
-
-class PromptAgent(UncheckedBaseModel):
- prompt: typing.Optional[str] = pydantic.Field(default=None)
- """
- The prompt for the agent
- """
-
- llm: typing.Optional[Llm] = pydantic.Field(default=None)
- """
- The LLM to query with the prompt and the chat history
- """
-
- temperature: typing.Optional[float] = pydantic.Field(default=None)
- """
- The temperature for the LLM
- """
-
- max_tokens: typing.Optional[int] = pydantic.Field(default=None)
- """
- If greater than 0, maximum number of tokens the LLM can predict
- """
-
- tools: typing.Optional[typing.List[PromptAgentOutputToolsItem]] = pydantic.Field(default=None)
- """
- A list of tools that the agent can use over the course of the conversation
- """
-
- tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
- """
- A list of IDs of tools used by the agent
- """
-
- mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
- """
- A list of MCP server ids to be used by the agent
- """
-
- native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
- """
- A list of Native MCP server ids to be used by the agent
- """
-
- knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None)
- """
- A list of knowledge bases to be used by the agent
- """
-
- custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None)
- """
- Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM'
- """
-
- ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None)
- """
- Whether to ignore the default personality
- """
-
- rag: typing.Optional[RagConfig] = pydantic.Field(default=None)
- """
- Configuration for RAG
- """
-
- if IS_PYDANTIC_V2:
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
- else:
-
- class Config:
- frozen = True
- smart_union = True
- extra = pydantic.Extra.allow
-
-
-from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001
-from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001
-
-update_forward_refs(PromptAgent)
+PromptAgent = typing.Optional[typing.Any]
diff --git a/src/elevenlabs/types/prompt_agent_api_model_input.py b/src/elevenlabs/types/prompt_agent_api_model_input.py
new file mode 100644
index 00000000..f6f971e3
--- /dev/null
+++ b/src/elevenlabs/types/prompt_agent_api_model_input.py
@@ -0,0 +1,97 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.unchecked_base_model import UncheckedBaseModel
+from .built_in_tools_input import BuiltInToolsInput
+from .custom_llm import CustomLlm
+from .knowledge_base_locator import KnowledgeBaseLocator
+from .llm import Llm
+from .prompt_agent_api_model_input_tools_item import PromptAgentApiModelInputToolsItem
+from .rag_config import RagConfig
+
+
+class PromptAgentApiModelInput(UncheckedBaseModel):
+ prompt: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The prompt for the agent
+ """
+
+ llm: typing.Optional[Llm] = pydantic.Field(default=None)
+ """
+ The LLM to query with the prompt and the chat history
+ """
+
+ temperature: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The temperature for the LLM
+ """
+
+ max_tokens: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ If greater than 0, maximum number of tokens the LLM can predict
+ """
+
+ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of tools used by the agent
+ """
+
+ built_in_tools: typing.Optional[BuiltInToolsInput] = pydantic.Field(default=None)
+ """
+ Built-in system tools to be used by the agent
+ """
+
+ mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of MCP server ids to be used by the agent
+ """
+
+ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of Native MCP server ids to be used by the agent
+ """
+
+ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None)
+ """
+ A list of knowledge bases to be used by the agent
+ """
+
+ custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None)
+ """
+ Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM'
+ """
+
+ ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether to ignore the default personality
+ """
+
+ rag: typing.Optional[RagConfig] = pydantic.Field(default=None)
+ """
+ Configuration for RAG
+ """
+
+ tools: typing.Optional[typing.List[PromptAgentApiModelInputToolsItem]] = pydantic.Field(default=None)
+ """
+ A list of tools that the agent can use over the course of the conversation, use tool_ids instead
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
+from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
+
+update_forward_refs(PromptAgentApiModelInput)
diff --git a/src/elevenlabs/types/prompt_agent_input_tools_item.py b/src/elevenlabs/types/prompt_agent_api_model_input_tools_item.py
similarity index 82%
rename from src/elevenlabs/types/prompt_agent_input_tools_item.py
rename to src/elevenlabs/types/prompt_agent_api_model_input_tools_item.py
index 263b924c..ed5ccd46 100644
--- a/src/elevenlabs/types/prompt_agent_input_tools_item.py
+++ b/src/elevenlabs/types/prompt_agent_api_model_input_tools_item.py
@@ -15,13 +15,12 @@
from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput
-class PromptAgentInputToolsItem_Client(UncheckedBaseModel):
+class PromptAgentApiModelInputToolsItem_Client(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["client"] = "client"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -39,13 +38,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentInputToolsItem_Mcp(UncheckedBaseModel):
+class PromptAgentApiModelInputToolsItem_Mcp(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["mcp"] = "mcp"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -68,13 +66,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentInputToolsItem_System(UncheckedBaseModel):
+class PromptAgentApiModelInputToolsItem_System(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["system"] = "system"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -90,13 +87,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentInputToolsItem_Webhook(UncheckedBaseModel):
+class PromptAgentApiModelInputToolsItem_Webhook(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["webhook"] = "webhook"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -116,15 +112,15 @@ class Config:
from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-PromptAgentInputToolsItem = typing_extensions.Annotated[
+PromptAgentApiModelInputToolsItem = typing_extensions.Annotated[
typing.Union[
- PromptAgentInputToolsItem_Client,
- PromptAgentInputToolsItem_Mcp,
- PromptAgentInputToolsItem_System,
- PromptAgentInputToolsItem_Webhook,
+ PromptAgentApiModelInputToolsItem_Client,
+ PromptAgentApiModelInputToolsItem_Mcp,
+ PromptAgentApiModelInputToolsItem_System,
+ PromptAgentApiModelInputToolsItem_Webhook,
],
UnionMetadata(discriminant="type"),
]
-update_forward_refs(PromptAgentInputToolsItem_Client)
-update_forward_refs(PromptAgentInputToolsItem_Mcp)
-update_forward_refs(PromptAgentInputToolsItem_Webhook)
+update_forward_refs(PromptAgentApiModelInputToolsItem_Client)
+update_forward_refs(PromptAgentApiModelInputToolsItem_Mcp)
+update_forward_refs(PromptAgentApiModelInputToolsItem_Webhook)
diff --git a/src/elevenlabs/types/prompt_agent_api_model_output.py b/src/elevenlabs/types/prompt_agent_api_model_output.py
new file mode 100644
index 00000000..82361323
--- /dev/null
+++ b/src/elevenlabs/types/prompt_agent_api_model_output.py
@@ -0,0 +1,97 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.unchecked_base_model import UncheckedBaseModel
+from .built_in_tools_output import BuiltInToolsOutput
+from .custom_llm import CustomLlm
+from .knowledge_base_locator import KnowledgeBaseLocator
+from .llm import Llm
+from .prompt_agent_api_model_output_tools_item import PromptAgentApiModelOutputToolsItem
+from .rag_config import RagConfig
+
+
+class PromptAgentApiModelOutput(UncheckedBaseModel):
+ prompt: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The prompt for the agent
+ """
+
+ llm: typing.Optional[Llm] = pydantic.Field(default=None)
+ """
+ The LLM to query with the prompt and the chat history
+ """
+
+ temperature: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The temperature for the LLM
+ """
+
+ max_tokens: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ If greater than 0, maximum number of tokens the LLM can predict
+ """
+
+ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of tools used by the agent
+ """
+
+ built_in_tools: typing.Optional[BuiltInToolsOutput] = pydantic.Field(default=None)
+ """
+ Built-in system tools to be used by the agent
+ """
+
+ mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of MCP server ids to be used by the agent
+ """
+
+ native_mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of Native MCP server ids to be used by the agent
+ """
+
+ knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None)
+ """
+ A list of knowledge bases to be used by the agent
+ """
+
+ custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None)
+ """
+ Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM'
+ """
+
+ ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether to ignore the default personality
+ """
+
+ rag: typing.Optional[RagConfig] = pydantic.Field(default=None)
+ """
+ Configuration for RAG
+ """
+
+ tools: typing.Optional[typing.List[PromptAgentApiModelOutputToolsItem]] = pydantic.Field(default=None)
+ """
+ A list of tools that the agent can use over the course of the conversation, use tool_ids instead
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001
+from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001
+
+update_forward_refs(PromptAgentApiModelOutput)
diff --git a/src/elevenlabs/types/prompt_agent_output_tools_item.py b/src/elevenlabs/types/prompt_agent_api_model_output_tools_item.py
similarity index 81%
rename from src/elevenlabs/types/prompt_agent_output_tools_item.py
rename to src/elevenlabs/types/prompt_agent_api_model_output_tools_item.py
index 36b420bc..e4795652 100644
--- a/src/elevenlabs/types/prompt_agent_output_tools_item.py
+++ b/src/elevenlabs/types/prompt_agent_api_model_output_tools_item.py
@@ -15,13 +15,12 @@
from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput
-class PromptAgentOutputToolsItem_Client(UncheckedBaseModel):
+class PromptAgentApiModelOutputToolsItem_Client(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["client"] = "client"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -39,13 +38,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentOutputToolsItem_Mcp(UncheckedBaseModel):
+class PromptAgentApiModelOutputToolsItem_Mcp(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["mcp"] = "mcp"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -68,13 +66,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentOutputToolsItem_System(UncheckedBaseModel):
+class PromptAgentApiModelOutputToolsItem_System(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["system"] = "system"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -90,13 +87,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentOutputToolsItem_Webhook(UncheckedBaseModel):
+class PromptAgentApiModelOutputToolsItem_Webhook(UncheckedBaseModel):
"""
The type of tool
"""
type: typing.Literal["webhook"] = "webhook"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -116,15 +112,15 @@ class Config:
from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001
from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001
-PromptAgentOutputToolsItem = typing_extensions.Annotated[
+PromptAgentApiModelOutputToolsItem = typing_extensions.Annotated[
typing.Union[
- PromptAgentOutputToolsItem_Client,
- PromptAgentOutputToolsItem_Mcp,
- PromptAgentOutputToolsItem_System,
- PromptAgentOutputToolsItem_Webhook,
+ PromptAgentApiModelOutputToolsItem_Client,
+ PromptAgentApiModelOutputToolsItem_Mcp,
+ PromptAgentApiModelOutputToolsItem_System,
+ PromptAgentApiModelOutputToolsItem_Webhook,
],
UnionMetadata(discriminant="type"),
]
-update_forward_refs(PromptAgentOutputToolsItem_Client)
-update_forward_refs(PromptAgentOutputToolsItem_Mcp)
-update_forward_refs(PromptAgentOutputToolsItem_Webhook)
+update_forward_refs(PromptAgentApiModelOutputToolsItem_Client)
+update_forward_refs(PromptAgentApiModelOutputToolsItem_Mcp)
+update_forward_refs(PromptAgentApiModelOutputToolsItem_Webhook)
diff --git a/src/elevenlabs/types/prompt_agent_override.py b/src/elevenlabs/types/prompt_agent_api_model_override.py
similarity index 91%
rename from src/elevenlabs/types/prompt_agent_override.py
rename to src/elevenlabs/types/prompt_agent_api_model_override.py
index 75495388..7fef065f 100644
--- a/src/elevenlabs/types/prompt_agent_override.py
+++ b/src/elevenlabs/types/prompt_agent_api_model_override.py
@@ -7,7 +7,7 @@
from ..core.unchecked_base_model import UncheckedBaseModel
-class PromptAgentOverride(UncheckedBaseModel):
+class PromptAgentApiModelOverride(UncheckedBaseModel):
prompt: typing.Optional[str] = pydantic.Field(default=None)
"""
The prompt for the agent
diff --git a/src/elevenlabs/types/prompt_agent_override_config.py b/src/elevenlabs/types/prompt_agent_api_model_override_config.py
similarity index 91%
rename from src/elevenlabs/types/prompt_agent_override_config.py
rename to src/elevenlabs/types/prompt_agent_api_model_override_config.py
index fd2f54df..24ff78d9 100644
--- a/src/elevenlabs/types/prompt_agent_override_config.py
+++ b/src/elevenlabs/types/prompt_agent_api_model_override_config.py
@@ -7,7 +7,7 @@
from ..core.unchecked_base_model import UncheckedBaseModel
-class PromptAgentOverrideConfig(UncheckedBaseModel):
+class PromptAgentApiModelOverrideConfig(UncheckedBaseModel):
prompt: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to allow overriding the prompt field.
diff --git a/src/elevenlabs/types/prompt_agent_db_model.py b/src/elevenlabs/types/prompt_agent_db_model.py
index 8f586e2c..b0aef6a1 100644
--- a/src/elevenlabs/types/prompt_agent_db_model.py
+++ b/src/elevenlabs/types/prompt_agent_db_model.py
@@ -1,17 +1,14 @@
# This file was auto-generated by Fern from our API Definition.
-from __future__ import annotations
-
import typing
import pydantic
-from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
-from .built_in_tools import BuiltInTools
+from .built_in_tools_input import BuiltInToolsInput
from .custom_llm import CustomLlm
from .knowledge_base_locator import KnowledgeBaseLocator
from .llm import Llm
-from .prompt_agent_db_model_tools_item import PromptAgentDbModelToolsItem
from .rag_config import RagConfig
@@ -36,14 +33,14 @@ class PromptAgentDbModel(UncheckedBaseModel):
If greater than 0, maximum number of tokens the LLM can predict
"""
- tools: typing.Optional[typing.List[PromptAgentDbModelToolsItem]] = pydantic.Field(default=None)
+ tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
- A list of tools that the agent can use over the course of the conversation
+ A list of IDs of tools used by the agent
"""
- tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ built_in_tools: typing.Optional[BuiltInToolsInput] = pydantic.Field(default=None)
"""
- A list of IDs of tools used by the agent
+ Built-in system tools to be used by the agent
"""
mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
@@ -77,7 +74,7 @@ class PromptAgentDbModel(UncheckedBaseModel):
"""
knowledge_base_document_ids: typing.Optional[typing.List[str]] = None
- built_in_tools: typing.Optional[BuiltInTools] = None
+ tools: typing.Optional[typing.Optional[typing.Any]] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -87,9 +84,3 @@ class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
-
-
-from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
-from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-
-update_forward_refs(PromptAgentDbModel)
diff --git a/src/elevenlabs/types/system_tool_config_input.py b/src/elevenlabs/types/system_tool_config_input.py
index cb0373ce..5d406f7f 100644
--- a/src/elevenlabs/types/system_tool_config_input.py
+++ b/src/elevenlabs/types/system_tool_config_input.py
@@ -13,7 +13,6 @@ class SystemToolConfigInput(UncheckedBaseModel):
A system tool is a tool that is used to call a system method in the server
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/system_tool_config_output.py b/src/elevenlabs/types/system_tool_config_output.py
index e86d6a5d..21fa970a 100644
--- a/src/elevenlabs/types/system_tool_config_output.py
+++ b/src/elevenlabs/types/system_tool_config_output.py
@@ -13,7 +13,6 @@ class SystemToolConfigOutput(UncheckedBaseModel):
A system tool is a tool that is used to call a system method in the server
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/tool_request_model.py b/src/elevenlabs/types/tool_request_model.py
new file mode 100644
index 00000000..d32683e8
--- /dev/null
+++ b/src/elevenlabs/types/tool_request_model.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.unchecked_base_model import UncheckedBaseModel
+from .tool_request_model_tool_config import ToolRequestModelToolConfig
+
+
+class ToolRequestModel(UncheckedBaseModel):
+ tool_config: ToolRequestModelToolConfig = pydantic.Field()
+ """
+ Configuration for the tool
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
+from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
+
+update_forward_refs(ToolRequestModel)
diff --git a/src/elevenlabs/types/prompt_agent_db_model_tools_item.py b/src/elevenlabs/types/tool_request_model_tool_config.py
similarity index 79%
rename from src/elevenlabs/types/prompt_agent_db_model_tools_item.py
rename to src/elevenlabs/types/tool_request_model_tool_config.py
index 8072c9c8..93b43c5e 100644
--- a/src/elevenlabs/types/prompt_agent_db_model_tools_item.py
+++ b/src/elevenlabs/types/tool_request_model_tool_config.py
@@ -15,13 +15,12 @@
from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput
-class PromptAgentDbModelToolsItem_Client(UncheckedBaseModel):
+class ToolRequestModelToolConfig_Client(UncheckedBaseModel):
"""
- The type of tool
+ Configuration for the tool
"""
type: typing.Literal["client"] = "client"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -39,13 +38,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentDbModelToolsItem_Mcp(UncheckedBaseModel):
+class ToolRequestModelToolConfig_Mcp(UncheckedBaseModel):
"""
- The type of tool
+ Configuration for the tool
"""
type: typing.Literal["mcp"] = "mcp"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -68,13 +66,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentDbModelToolsItem_System(UncheckedBaseModel):
+class ToolRequestModelToolConfig_System(UncheckedBaseModel):
"""
- The type of tool
+ Configuration for the tool
"""
type: typing.Literal["system"] = "system"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -90,13 +87,12 @@ class Config:
extra = pydantic.Extra.allow
-class PromptAgentDbModelToolsItem_Webhook(UncheckedBaseModel):
+class ToolRequestModelToolConfig_Webhook(UncheckedBaseModel):
"""
- The type of tool
+ Configuration for the tool
"""
type: typing.Literal["webhook"] = "webhook"
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = None
@@ -116,15 +112,15 @@ class Config:
from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput # noqa: E402, F401, I001
from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput # noqa: E402, F401, I001
-PromptAgentDbModelToolsItem = typing_extensions.Annotated[
+ToolRequestModelToolConfig = typing_extensions.Annotated[
typing.Union[
- PromptAgentDbModelToolsItem_Client,
- PromptAgentDbModelToolsItem_Mcp,
- PromptAgentDbModelToolsItem_System,
- PromptAgentDbModelToolsItem_Webhook,
+ ToolRequestModelToolConfig_Client,
+ ToolRequestModelToolConfig_Mcp,
+ ToolRequestModelToolConfig_System,
+ ToolRequestModelToolConfig_Webhook,
],
UnionMetadata(discriminant="type"),
]
-update_forward_refs(PromptAgentDbModelToolsItem_Client)
-update_forward_refs(PromptAgentDbModelToolsItem_Mcp)
-update_forward_refs(PromptAgentDbModelToolsItem_Webhook)
+update_forward_refs(ToolRequestModelToolConfig_Client)
+update_forward_refs(ToolRequestModelToolConfig_Mcp)
+update_forward_refs(ToolRequestModelToolConfig_Webhook)
diff --git a/src/elevenlabs/types/tool_response_model.py b/src/elevenlabs/types/tool_response_model.py
new file mode 100644
index 00000000..e92ddb6c
--- /dev/null
+++ b/src/elevenlabs/types/tool_response_model.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.unchecked_base_model import UncheckedBaseModel
+from .resource_access_info import ResourceAccessInfo
+from .tool_response_model_tool_config import ToolResponseModelToolConfig
+
+
+class ToolResponseModel(UncheckedBaseModel):
+ id: str
+ tool_config: ToolResponseModelToolConfig = pydantic.Field()
+ """
+ The type of tool
+ """
+
+ access_info: ResourceAccessInfo
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001
+from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001
+
+update_forward_refs(ToolResponseModel)
diff --git a/src/elevenlabs/types/tool_response_model_tool_config.py b/src/elevenlabs/types/tool_response_model_tool_config.py
new file mode 100644
index 00000000..4915519b
--- /dev/null
+++ b/src/elevenlabs/types/tool_response_model_tool_config.py
@@ -0,0 +1,126 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+import typing_extensions
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.unchecked_base_model import UncheckedBaseModel, UnionMetadata
+from .dynamic_variables_config import DynamicVariablesConfig
+from .integration_type import IntegrationType
+from .mcp_approval_policy import McpApprovalPolicy
+from .system_tool_config_output_params import SystemToolConfigOutputParams
+from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput
+
+
+class ToolResponseModelToolConfig_Client(UncheckedBaseModel):
+ """
+ The type of tool
+ """
+
+ type: typing.Literal["client"] = "client"
+ name: str
+ description: str
+ response_timeout_secs: typing.Optional[int] = None
+ parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None
+ expects_response: typing.Optional[bool] = None
+ dynamic_variables: typing.Optional[DynamicVariablesConfig] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ToolResponseModelToolConfig_Mcp(UncheckedBaseModel):
+ """
+ The type of tool
+ """
+
+ type: typing.Literal["mcp"] = "mcp"
+ name: str
+ description: str
+ response_timeout_secs: typing.Optional[int] = None
+ integration_type: IntegrationType
+ parameters: typing.Optional["ObjectJsonSchemaPropertyOutput"] = None
+ approval_policy: typing.Optional[McpApprovalPolicy] = None
+ mcp_tool_name: str
+ mcp_tool_description: str
+ mcp_server_id: str
+ mcp_server_name: str
+ mcp_input_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ToolResponseModelToolConfig_System(UncheckedBaseModel):
+ """
+ The type of tool
+ """
+
+ type: typing.Literal["system"] = "system"
+ name: str
+ description: str
+ response_timeout_secs: typing.Optional[int] = None
+ params: SystemToolConfigOutputParams
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ToolResponseModelToolConfig_Webhook(UncheckedBaseModel):
+ """
+ The type of tool
+ """
+
+ type: typing.Literal["webhook"] = "webhook"
+ name: str
+ description: str
+ response_timeout_secs: typing.Optional[int] = None
+ api_schema: WebhookToolApiSchemaConfigOutput
+ dynamic_variables: typing.Optional[DynamicVariablesConfig] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001
+from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001
+
+ToolResponseModelToolConfig = typing_extensions.Annotated[
+ typing.Union[
+ ToolResponseModelToolConfig_Client,
+ ToolResponseModelToolConfig_Mcp,
+ ToolResponseModelToolConfig_System,
+ ToolResponseModelToolConfig_Webhook,
+ ],
+ UnionMetadata(discriminant="type"),
+]
+update_forward_refs(ToolResponseModelToolConfig_Client)
+update_forward_refs(ToolResponseModelToolConfig_Mcp)
+update_forward_refs(ToolResponseModelToolConfig_Webhook)
diff --git a/src/elevenlabs/types/tools_response_model.py b/src/elevenlabs/types/tools_response_model.py
new file mode 100644
index 00000000..e408c726
--- /dev/null
+++ b/src/elevenlabs/types/tools_response_model.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+
+import typing
+
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs
+from ..core.unchecked_base_model import UncheckedBaseModel
+from .tool_response_model import ToolResponseModel
+
+
+class ToolsResponseModel(UncheckedBaseModel):
+ tools: typing.List[ToolResponseModel]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput # noqa: E402, F401, I001
+from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput # noqa: E402, F401, I001
+
+update_forward_refs(ToolsResponseModel)
diff --git a/src/elevenlabs/types/webhook_tool_config_input.py b/src/elevenlabs/types/webhook_tool_config_input.py
index 3fde81e4..6a7e114d 100644
--- a/src/elevenlabs/types/webhook_tool_config_input.py
+++ b/src/elevenlabs/types/webhook_tool_config_input.py
@@ -16,7 +16,6 @@ class WebhookToolConfigInput(UncheckedBaseModel):
A webhook tool is a tool that calls an external webhook from our server
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/webhook_tool_config_output.py b/src/elevenlabs/types/webhook_tool_config_output.py
index c28c83c9..9f7322b2 100644
--- a/src/elevenlabs/types/webhook_tool_config_output.py
+++ b/src/elevenlabs/types/webhook_tool_config_output.py
@@ -16,7 +16,6 @@ class WebhookToolConfigOutput(UncheckedBaseModel):
A webhook tool is a tool that calls an external webhook from our server
"""
- id: typing.Optional[str] = None
name: str
description: str
response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None)
diff --git a/src/elevenlabs/types/workspace_group_permission.py b/src/elevenlabs/types/workspace_group_permission.py
new file mode 100644
index 00000000..8a1f1047
--- /dev/null
+++ b/src/elevenlabs/types/workspace_group_permission.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+WorkspaceGroupPermission = typing.Union[
+ typing.Literal[
+ "text_to_speech",
+ "speech_to_speech",
+ "voice_lab",
+ "sound_effects",
+ "projects",
+ "voiceover_studio",
+ "dubbing",
+ "audio_native",
+ "conversational_ai",
+ "voice_isolator",
+ "ai_speech_classifier",
+ "add_voice_from_voice_library",
+ "create_instant_voice_clone",
+ "create_professional_voice_clone",
+ "create_user_api_key",
+ "publish_studio_project",
+ ],
+ typing.Any,
+]
diff --git a/src/elevenlabs/types/dependent_unknown_agent_tool_identifier.py b/src/elevenlabs/types/workspace_group_response_model.py
similarity index 66%
rename from src/elevenlabs/types/dependent_unknown_agent_tool_identifier.py
rename to src/elevenlabs/types/workspace_group_response_model.py
index e9765823..9d182db1 100644
--- a/src/elevenlabs/types/dependent_unknown_agent_tool_identifier.py
+++ b/src/elevenlabs/types/workspace_group_response_model.py
@@ -5,13 +5,14 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
+from .workspace_group_permission import WorkspaceGroupPermission
-class DependentUnknownAgentToolIdentifier(UncheckedBaseModel):
- """
- A model that represents an tool dependent on a knowledge base/tools
- to which the user has no direct access.
- """
+class WorkspaceGroupResponseModel(UncheckedBaseModel):
+ name: str
+ id: str
+ members: typing.List[str]
+ permissions: typing.Optional[typing.List[WorkspaceGroupPermission]] = 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/workspace/client.py b/src/elevenlabs/workspace/client.py
index 3074232d..89d6e58a 100644
--- a/src/elevenlabs/workspace/client.py
+++ b/src/elevenlabs/workspace/client.py
@@ -4,6 +4,8 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
+from ..types.default_sharing_preferences_response_model import DefaultSharingPreferencesResponseModel
+from ..types.share_option_response_model import ShareOptionResponseModel
from .groups.client import AsyncGroupsClient, GroupsClient
from .invites.client import AsyncInvitesClient, InvitesClient
from .members.client import AsyncMembersClient, MembersClient
@@ -68,6 +70,97 @@ def update_user_auto_provisioning(
_response = self._raw_client.update_user_auto_provisioning(enabled=enabled, request_options=request_options)
return _response.data
+ def get_default_sharing_preferences(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> DefaultSharingPreferencesResponseModel:
+ """
+ Get the user's default sharing preferences.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DefaultSharingPreferencesResponseModel
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.workspace.get_default_sharing_preferences()
+ """
+ _response = self._raw_client.get_default_sharing_preferences(request_options=request_options)
+ return _response.data
+
+ def update_default_sharing_preferences(
+ self, *, default_sharing_groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Optional[typing.Any]:
+ """
+ Update the user's default sharing preferences.
+
+ Parameters
+ ----------
+ default_sharing_groups : typing.Sequence[str]
+ List of group IDs to share with by default
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.Optional[typing.Any]
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.workspace.update_default_sharing_preferences(
+ default_sharing_groups=["default_sharing_groups"],
+ )
+ """
+ _response = self._raw_client.update_default_sharing_preferences(
+ default_sharing_groups=default_sharing_groups, request_options=request_options
+ )
+ return _response.data
+
+ def get_share_options(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.List[ShareOptionResponseModel]:
+ """
+ Get the share options for a workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.List[ShareOptionResponseModel]
+ Successful Response
+
+ Examples
+ --------
+ from elevenlabs import ElevenLabs
+
+ client = ElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+ client.workspace.get_share_options()
+ """
+ _response = self._raw_client.get_share_options(request_options=request_options)
+ return _response.data
+
class AsyncWorkspaceClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -132,3 +225,118 @@ async def main() -> None:
enabled=enabled, request_options=request_options
)
return _response.data
+
+ async def get_default_sharing_preferences(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> DefaultSharingPreferencesResponseModel:
+ """
+ Get the user's default sharing preferences.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DefaultSharingPreferencesResponseModel
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.workspace.get_default_sharing_preferences()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.get_default_sharing_preferences(request_options=request_options)
+ return _response.data
+
+ async def update_default_sharing_preferences(
+ self, *, default_sharing_groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Optional[typing.Any]:
+ """
+ Update the user's default sharing preferences.
+
+ Parameters
+ ----------
+ default_sharing_groups : typing.Sequence[str]
+ List of group IDs to share with by default
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.Optional[typing.Any]
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.workspace.update_default_sharing_preferences(
+ default_sharing_groups=["default_sharing_groups"],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.update_default_sharing_preferences(
+ default_sharing_groups=default_sharing_groups, request_options=request_options
+ )
+ return _response.data
+
+ async def get_share_options(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.List[ShareOptionResponseModel]:
+ """
+ Get the share options for a workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.List[ShareOptionResponseModel]
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from elevenlabs import AsyncElevenLabs
+
+ client = AsyncElevenLabs(
+ api_key="YOUR_API_KEY",
+ )
+
+
+ async def main() -> None:
+ await client.workspace.get_share_options()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._raw_client.get_share_options(request_options=request_options)
+ return _response.data
diff --git a/src/elevenlabs/workspace/raw_client.py b/src/elevenlabs/workspace/raw_client.py
index 3183bf3d..90263396 100644
--- a/src/elevenlabs/workspace/raw_client.py
+++ b/src/elevenlabs/workspace/raw_client.py
@@ -9,7 +9,9 @@
from ..core.request_options import RequestOptions
from ..core.unchecked_base_model import construct_type
from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.default_sharing_preferences_response_model import DefaultSharingPreferencesResponseModel
from ..types.http_validation_error import HttpValidationError
+from ..types.share_option_response_model import ShareOptionResponseModel
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
@@ -78,6 +80,162 @@ def update_user_auto_provisioning(
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+ def get_default_sharing_preferences(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[DefaultSharingPreferencesResponseModel]:
+ """
+ Get the user's default sharing preferences.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[DefaultSharingPreferencesResponseModel]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/workspace/default-sharing-preferences",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ DefaultSharingPreferencesResponseModel,
+ construct_type(
+ type_=DefaultSharingPreferencesResponseModel, # type: 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 update_default_sharing_preferences(
+ self, *, default_sharing_groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[typing.Optional[typing.Any]]:
+ """
+ Update the user's default sharing preferences.
+
+ Parameters
+ ----------
+ default_sharing_groups : typing.Sequence[str]
+ List of group IDs to share with by default
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[typing.Optional[typing.Any]]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/workspace/default-sharing-preferences",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json={
+ "default_sharing_groups": default_sharing_groups,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if _response is None or not _response.text.strip():
+ return HttpResponse(response=_response, data=None)
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ typing.Optional[typing.Any],
+ construct_type(
+ type_=typing.Optional[typing.Any], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return HttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 get_share_options(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> HttpResponse[typing.List[ShareOptionResponseModel]]:
+ """
+ Get the share options for a workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ HttpResponse[typing.List[ShareOptionResponseModel]]
+ Successful Response
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "v1/workspace/share-options",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ typing.List[ShareOptionResponseModel],
+ construct_type(
+ type_=typing.List[ShareOptionResponseModel], # type: 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)
+
class AsyncRawWorkspaceClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -141,3 +299,159 @@ async def update_user_auto_provisioning(
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
+
+ async def get_default_sharing_preferences(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[DefaultSharingPreferencesResponseModel]:
+ """
+ Get the user's default sharing preferences.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[DefaultSharingPreferencesResponseModel]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/workspace/default-sharing-preferences",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ DefaultSharingPreferencesResponseModel,
+ construct_type(
+ type_=DefaultSharingPreferencesResponseModel, # type: 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 update_default_sharing_preferences(
+ self, *, default_sharing_groups: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
+ """
+ Update the user's default sharing preferences.
+
+ Parameters
+ ----------
+ default_sharing_groups : typing.Sequence[str]
+ List of group IDs to share with by default
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[typing.Optional[typing.Any]]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/workspace/default-sharing-preferences",
+ base_url=self._client_wrapper.get_environment().base,
+ method="POST",
+ json={
+ "default_sharing_groups": default_sharing_groups,
+ },
+ headers={
+ "content-type": "application/json",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if _response is None or not _response.text.strip():
+ return AsyncHttpResponse(response=_response, data=None)
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ typing.Optional[typing.Any],
+ construct_type(
+ type_=typing.Optional[typing.Any], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ return AsyncHttpResponse(response=_response, data=_data)
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ headers=dict(_response.headers),
+ body=typing.cast(
+ 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 get_share_options(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AsyncHttpResponse[typing.List[ShareOptionResponseModel]]:
+ """
+ Get the share options for a workspace.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AsyncHttpResponse[typing.List[ShareOptionResponseModel]]
+ Successful Response
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "v1/workspace/share-options",
+ base_url=self._client_wrapper.get_environment().base,
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ _data = typing.cast(
+ typing.List[ShareOptionResponseModel],
+ construct_type(
+ type_=typing.List[ShareOptionResponseModel], # type: 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)