From 2567ceee979d202bea89732aa30b23bf53f4aa86 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 01:43:58 +0200 Subject: [PATCH] SDK regeneration (#600) Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- reference.md | 44 +++++------- .../conversational_ai/agents/client.py | 72 +++++++++---------- .../conversational_ai/agents/raw_client.py | 16 ----- src/elevenlabs/core/client_wrapper.py | 4 +- src/elevenlabs/types/agent_config.py | 45 +++++++++++- .../conversation_simulation_specification.py | 10 ++- src/elevenlabs/types/conversational_config.py | 10 ++- .../types/get_agent_response_model.py | 11 ++- 9 files changed, 128 insertions(+), 86 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index da8efd8f..495a3467 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "elevenlabs" [tool.poetry] name = "elevenlabs" -version = "v2.9.0" +version = "v2.9.1" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 48ff556a..7bba54de 100644 --- a/reference.md +++ b/reference.md @@ -6172,14 +6172,6 @@ client.conversational_ai.agents.create(
-**workflow:** `typing.Optional[typing.Optional[typing.Any]]` - -
-
- -
-
- **name:** `typing.Optional[str]` — A name to make the agent easier to find
@@ -6422,14 +6414,6 @@ client.conversational_ai.agents.update(
-**workflow:** `typing.Optional[typing.Optional[typing.Any]]` - -
-
- -
-
- **name:** `typing.Optional[str]` — A name to make the agent easier to find
@@ -6647,7 +6631,11 @@ Run a conversation between the agent and a simulated user.
```python -from elevenlabs import ConversationSimulationSpecification, ElevenLabs +from elevenlabs import ( + AgentConfig, + ConversationSimulationSpecification, + ElevenLabs, +) client = ElevenLabs( api_key="YOUR_API_KEY", @@ -6655,10 +6643,10 @@ client = ElevenLabs( client.conversational_ai.agents.simulate_conversation( agent_id="21m00Tcm4TlvDq8ikWAM", simulation_specification=ConversationSimulationSpecification( - simulated_user_config={ - "first_message": "Hello, how can I help you today?", - "language": "en", - }, + simulated_user_config=AgentConfig( + first_message="Hello, how can I help you today?", + language="en", + ), ), ) @@ -6747,7 +6735,11 @@ Run a conversation between the agent and a simulated user and stream back the re
```python -from elevenlabs import ConversationSimulationSpecification, ElevenLabs +from elevenlabs import ( + AgentConfig, + ConversationSimulationSpecification, + ElevenLabs, +) client = ElevenLabs( api_key="YOUR_API_KEY", @@ -6755,10 +6747,10 @@ client = ElevenLabs( client.conversational_ai.agents.simulate_conversation_stream( agent_id="21m00Tcm4TlvDq8ikWAM", simulation_specification=ConversationSimulationSpecification( - simulated_user_config={ - "first_message": "Hello, how can I help you today?", - "language": "en", - }, + simulated_user_config=AgentConfig( + first_message="Hello, how can I help you today?", + language="en", + ), ), ) diff --git a/src/elevenlabs/conversational_ai/agents/client.py b/src/elevenlabs/conversational_ai/agents/client.py index 5da6be79..6e852507 100644 --- a/src/elevenlabs/conversational_ai/agents/client.py +++ b/src/elevenlabs/conversational_ai/agents/client.py @@ -49,7 +49,6 @@ def create( *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -65,8 +64,6 @@ def create( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -95,7 +92,6 @@ def create( _response = self._raw_client.create( conversation_config=conversation_config, platform_settings=platform_settings, - workflow=workflow, name=name, tags=tags, request_options=request_options, @@ -169,7 +165,6 @@ def update( *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -188,8 +183,6 @@ def update( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -219,7 +212,6 @@ def update( agent_id, conversation_config=conversation_config, platform_settings=platform_settings, - workflow=workflow, name=name, tags=tags, request_options=request_options, @@ -346,7 +338,11 @@ def simulate_conversation( Examples -------- - from elevenlabs import ConversationSimulationSpecification, ElevenLabs + from elevenlabs import ( + AgentConfig, + ConversationSimulationSpecification, + ElevenLabs, + ) client = ElevenLabs( api_key="YOUR_API_KEY", @@ -354,10 +350,10 @@ def simulate_conversation( client.conversational_ai.agents.simulate_conversation( agent_id="21m00Tcm4TlvDq8ikWAM", simulation_specification=ConversationSimulationSpecification( - simulated_user_config={ - "first_message": "Hello, how can I help you today?", - "language": "en", - }, + simulated_user_config=AgentConfig( + first_message="Hello, how can I help you today?", + language="en", + ), ), ) """ @@ -405,7 +401,11 @@ def simulate_conversation_stream( Examples -------- - from elevenlabs import ConversationSimulationSpecification, ElevenLabs + from elevenlabs import ( + AgentConfig, + ConversationSimulationSpecification, + ElevenLabs, + ) client = ElevenLabs( api_key="YOUR_API_KEY", @@ -413,10 +413,10 @@ def simulate_conversation_stream( client.conversational_ai.agents.simulate_conversation_stream( agent_id="21m00Tcm4TlvDq8ikWAM", simulation_specification=ConversationSimulationSpecification( - simulated_user_config={ - "first_message": "Hello, how can I help you today?", - "language": "en", - }, + simulated_user_config=AgentConfig( + first_message="Hello, how can I help you today?", + language="en", + ), ), ) """ @@ -457,7 +457,6 @@ async def create( *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -473,8 +472,6 @@ async def create( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -511,7 +508,6 @@ async def main() -> None: _response = await self._raw_client.create( conversation_config=conversation_config, platform_settings=platform_settings, - workflow=workflow, name=name, tags=tags, request_options=request_options, @@ -603,7 +599,6 @@ async def update( *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -622,8 +617,6 @@ async def update( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -661,7 +654,6 @@ async def main() -> None: agent_id, conversation_config=conversation_config, platform_settings=platform_settings, - workflow=workflow, name=name, tags=tags, request_options=request_options, @@ -806,7 +798,11 @@ async def simulate_conversation( -------- import asyncio - from elevenlabs import AsyncElevenLabs, ConversationSimulationSpecification + from elevenlabs import ( + AgentConfig, + AsyncElevenLabs, + ConversationSimulationSpecification, + ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", @@ -817,10 +813,10 @@ async def main() -> None: await client.conversational_ai.agents.simulate_conversation( agent_id="21m00Tcm4TlvDq8ikWAM", simulation_specification=ConversationSimulationSpecification( - simulated_user_config={ - "first_message": "Hello, how can I help you today?", - "language": "en", - }, + simulated_user_config=AgentConfig( + first_message="Hello, how can I help you today?", + language="en", + ), ), ) @@ -873,7 +869,11 @@ async def simulate_conversation_stream( -------- import asyncio - from elevenlabs import AsyncElevenLabs, ConversationSimulationSpecification + from elevenlabs import ( + AgentConfig, + AsyncElevenLabs, + ConversationSimulationSpecification, + ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", @@ -884,10 +884,10 @@ async def main() -> None: await client.conversational_ai.agents.simulate_conversation_stream( agent_id="21m00Tcm4TlvDq8ikWAM", simulation_specification=ConversationSimulationSpecification( - simulated_user_config={ - "first_message": "Hello, how can I help you today?", - "language": "en", - }, + simulated_user_config=AgentConfig( + first_message="Hello, how can I help you today?", + language="en", + ), ), ) diff --git a/src/elevenlabs/conversational_ai/agents/raw_client.py b/src/elevenlabs/conversational_ai/agents/raw_client.py index f8bdc1b9..cc7ec855 100644 --- a/src/elevenlabs/conversational_ai/agents/raw_client.py +++ b/src/elevenlabs/conversational_ai/agents/raw_client.py @@ -34,7 +34,6 @@ def create( *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -50,8 +49,6 @@ def create( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -76,7 +73,6 @@ def create( "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), - "workflow": workflow, "name": name, "tags": tags, }, @@ -208,7 +204,6 @@ def update( *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -227,8 +222,6 @@ def update( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -253,7 +246,6 @@ def update( "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), - "workflow": workflow, "name": name, "tags": tags, }, @@ -581,7 +573,6 @@ async def create( *, conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -597,8 +588,6 @@ async def create( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -623,7 +612,6 @@ async def create( "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), - "workflow": workflow, "name": name, "tags": tags, }, @@ -757,7 +745,6 @@ async def update( *, conversation_config: typing.Optional[ConversationalConfig] = OMIT, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, - workflow: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -776,8 +763,6 @@ async def update( platform_settings : typing.Optional[AgentPlatformSettingsRequestModel] Platform settings for the agent are all settings that aren't related to the conversation orchestration and content. - workflow : typing.Optional[typing.Optional[typing.Any]] - name : typing.Optional[str] A name to make the agent easier to find @@ -802,7 +787,6 @@ async def update( "platform_settings": convert_and_respect_annotation_metadata( object_=platform_settings, annotation=AgentPlatformSettingsRequestModel, direction="write" ), - "workflow": workflow, "name": name, "tags": tags, }, diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py index 8d96ebef..7548f6e7 100644 --- a/src/elevenlabs/core/client_wrapper.py +++ b/src/elevenlabs/core/client_wrapper.py @@ -14,10 +14,10 @@ def __init__(self, *, api_key: typing.Optional[str] = None, base_url: str, timeo def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "elevenlabs/v2.9.0", + "User-Agent": "elevenlabs/v2.9.1", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "v2.9.0", + "X-Fern-SDK-Version": "v2.9.1", } if self._api_key is not None: headers["xi-api-key"] = self._api_key diff --git a/src/elevenlabs/types/agent_config.py b/src/elevenlabs/types/agent_config.py index a684411f..4b2ff3a8 100644 --- a/src/elevenlabs/types/agent_config.py +++ b/src/elevenlabs/types/agent_config.py @@ -1,5 +1,48 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing -AgentConfig = typing.Optional[typing.Any] +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel +from .dynamic_variables_config import DynamicVariablesConfig +from .prompt_agent_api_model_output import PromptAgentApiModelOutput + + +class AgentConfig(UncheckedBaseModel): + first_message: typing.Optional[str] = pydantic.Field(default=None) + """ + If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. + """ + + language: typing.Optional[str] = pydantic.Field(default=None) + """ + Language of the agent - used for ASR and TTS + """ + + dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) + """ + Configuration for dynamic variables + """ + + prompt: typing.Optional[PromptAgentApiModelOutput] = pydantic.Field(default=None) + """ + The prompt for the agent + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +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(AgentConfig) diff --git a/src/elevenlabs/types/conversation_simulation_specification.py b/src/elevenlabs/types/conversation_simulation_specification.py index 97e90c99..6a6390df 100644 --- a/src/elevenlabs/types/conversation_simulation_specification.py +++ b/src/elevenlabs/types/conversation_simulation_specification.py @@ -1,9 +1,11 @@ # 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 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config import AgentConfig from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput @@ -39,3 +41,9 @@ 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(ConversationSimulationSpecification) diff --git a/src/elevenlabs/types/conversational_config.py b/src/elevenlabs/types/conversational_config.py index 39bb6aea..e545bd7e 100644 --- a/src/elevenlabs/types/conversational_config.py +++ b/src/elevenlabs/types/conversational_config.py @@ -1,9 +1,11 @@ # 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 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_config import AgentConfig from .asr_conversational_config import AsrConversationalConfig @@ -52,3 +54,9 @@ 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(ConversationalConfig) diff --git a/src/elevenlabs/types/get_agent_response_model.py b/src/elevenlabs/types/get_agent_response_model.py index d80ccef5..6e37d263 100644 --- a/src/elevenlabs/types/get_agent_response_model.py +++ b/src/elevenlabs/types/get_agent_response_model.py @@ -1,9 +1,11 @@ # 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 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .agent_metadata_response_model import AgentMetadataResponseModel from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel @@ -43,7 +45,6 @@ class GetAgentResponseModel(UncheckedBaseModel): The phone numbers of the agent """ - workflow: typing.Optional[typing.Optional[typing.Any]] = None access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None) """ The access information of the agent for the user @@ -62,3 +63,9 @@ 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(GetAgentResponseModel)