From abd155800da17746a7617342f7f85c40c70d48fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 23:57:55 +0000 Subject: [PATCH 1/6] feat(api): api update --- .stats.yml | 4 ++-- src/retell/types/call_list_params.py | 1 - src/retell/types/phone_call_response.py | 1 - src/retell/types/web_call_response.py | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5dbeef3f..ec79c5a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 39 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-a0dea2a1f12785ff40f1a6f1f9570781c63ba372dbb744f2fc61e0c5451f3bef.yml -openapi_spec_hash: 8083df98dc88d4882446f7165d28e0ea +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-0c2d04d531165632afeb112eb0ccd92353ad11463d0dbd849385e19faea73afc.yml +openapi_spec_hash: e127910bf47af0d74bb730185cbbd6b3 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/types/call_list_params.py b/src/retell/types/call_list_params.py index 07aabbd8..28633cd1 100644 --- a/src/retell/types/call_list_params.py +++ b/src/retell/types/call_list_params.py @@ -81,7 +81,6 @@ class FilterCriteria(TypedDict, total=False): "call_transfer", "voicemail_reached", "inactivity", - "machine_detected", "max_duration_reached", "concurrency_limit_reached", "no_valid_payment", diff --git a/src/retell/types/phone_call_response.py b/src/retell/types/phone_call_response.py index ac55a162..7c5b999c 100644 --- a/src/retell/types/phone_call_response.py +++ b/src/retell/types/phone_call_response.py @@ -464,7 +464,6 @@ class PhoneCallResponse(BaseModel): "call_transfer", "voicemail_reached", "inactivity", - "machine_detected", "max_duration_reached", "concurrency_limit_reached", "no_valid_payment", diff --git a/src/retell/types/web_call_response.py b/src/retell/types/web_call_response.py index ca1c693c..bbaee969 100644 --- a/src/retell/types/web_call_response.py +++ b/src/retell/types/web_call_response.py @@ -455,7 +455,6 @@ class WebCallResponse(BaseModel): "call_transfer", "voicemail_reached", "inactivity", - "machine_detected", "max_duration_reached", "concurrency_limit_reached", "no_valid_payment", From 0e2b1e44f3a3e6cd044bfd66d0fe6c1b4a1dfa54 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 10:31:31 +0000 Subject: [PATCH 2/6] chore(tests): run tests in parallel --- pyproject.toml | 3 ++- requirements-dev.lock | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e9473a7b..88d58bf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ dev-dependencies = [ "importlib-metadata>=6.7.0", "rich>=13.7.1", "nest_asyncio==1.6.0", + "pytest-xdist>=3.6.1", ] [tool.rye.scripts] @@ -127,7 +128,7 @@ replacement = '[\1](https://github.com/RetellAI/retell-python-sdk/tree/main/\g<2 [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "--tb=short" +addopts = "--tb=short -n auto" xfail_strict = true asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" diff --git a/requirements-dev.lock b/requirements-dev.lock index 25d1668c..e3931d8f 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -34,6 +34,8 @@ distro==1.8.0 exceptiongroup==1.2.2 # via anyio # via pytest +execnet==2.1.1 + # via pytest-xdist filelock==3.12.4 # via virtualenv h11==0.14.0 @@ -78,7 +80,9 @@ pygments==2.18.0 pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio + # via pytest-xdist pytest-asyncio==0.24.0 +pytest-xdist==3.7.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 From 6ea3bc69ddc6e5852a1563a232a427d980f03128 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 16:45:30 +0000 Subject: [PATCH 3/6] fix(client): correctly parse binary response | stream --- src/retell/_base_client.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/retell/_base_client.py b/src/retell/_base_client.py index d4ef906f..6a8c6fc3 100644 --- a/src/retell/_base_client.py +++ b/src/retell/_base_client.py @@ -1066,7 +1066,14 @@ def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, APIResponse): raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") @@ -1569,7 +1576,14 @@ async def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, AsyncAPIResponse): raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") From d56f39e79341c0af2e54d68aea298465ae9c290b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 16:47:37 +0000 Subject: [PATCH 4/6] feat(api): api update --- .stats.yml | 4 ++-- tests/api_resources/test_llm.py | 40 +++++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index ec79c5a3..5eb0fc36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 39 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-0c2d04d531165632afeb112eb0ccd92353ad11463d0dbd849385e19faea73afc.yml -openapi_spec_hash: e127910bf47af0d74bb730185cbbd6b3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-e417bf4300d74bd66f72c4531394757b79fd3553380448e1226358fdd4398f5a.yml +openapi_spec_hash: 200908ec3e2943c7d7d353b85846d5df config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/tests/api_resources/test_llm.py b/tests/api_resources/test_llm.py index 6d92e509..a2aef83a 100644 --- a/tests/api_resources/test_llm.py +++ b/tests/api_resources/test_llm.py @@ -59,7 +59,15 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "tools": [ { "name": "transfer_to_support", - "type": "end_call", + "transfer_destination": { + "number": "16175551212", + "type": "predefined", + }, + "transfer_option": { + "type": "cold_transfer", + "show_transferee_as_caller": False, + }, + "type": "transfer_call", "description": "Transfer to the support team.", } ], @@ -207,7 +215,15 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "tools": [ { "name": "transfer_to_support", - "type": "end_call", + "transfer_destination": { + "number": "16175551212", + "type": "predefined", + }, + "transfer_option": { + "type": "cold_transfer", + "show_transferee_as_caller": False, + }, + "type": "transfer_call", "description": "Transfer to the support team.", } ], @@ -383,7 +399,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "tools": [ { "name": "transfer_to_support", - "type": "end_call", + "transfer_destination": { + "number": "16175551212", + "type": "predefined", + }, + "transfer_option": { + "type": "cold_transfer", + "show_transferee_as_caller": False, + }, + "type": "transfer_call", "description": "Transfer to the support team.", } ], @@ -531,7 +555,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "tools": [ { "name": "transfer_to_support", - "type": "end_call", + "transfer_destination": { + "number": "16175551212", + "type": "predefined", + }, + "transfer_option": { + "type": "cold_transfer", + "show_transferee_as_caller": False, + }, + "type": "transfer_call", "description": "Transfer to the support team.", } ], From cd5addb4641d3c136faf19b5b500f20d17ff0e6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 19:29:14 +0000 Subject: [PATCH 5/6] feat(api): api update --- .stats.yml | 4 +- src/retell/resources/agent.py | 100 ++++++++---------------- src/retell/types/agent_create_params.py | 62 ++++++++++----- src/retell/types/agent_response.py | 62 ++++++++++----- src/retell/types/agent_update_params.py | 62 ++++++++++----- tests/api_resources/test_agent.py | 36 ++++++--- 6 files changed, 190 insertions(+), 136 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5eb0fc36..a49775ca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 39 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-e417bf4300d74bd66f72c4531394757b79fd3553380448e1226358fdd4398f5a.yml -openapi_spec_hash: 200908ec3e2943c7d7d353b85846d5df +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-aa47014eca391b07848fe3f18c1c5081b6f5c214d64f470a65fb48a7211ec7d4.yml +openapi_spec_hash: b330cedf40c1ff1e0dc865e5227b0aa2 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/resources/agent.py b/src/retell/resources/agent.py index fbd0252a..dcc91dee 100644 --- a/src/retell/resources/agent.py +++ b/src/retell/resources/agent.py @@ -68,7 +68,6 @@ def create( | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, enable_transcription_formatting: bool | NotGiven = NOT_GIVEN, - enable_voicemail_detection: bool | NotGiven = NOT_GIVEN, end_call_after_silence_ms: int | NotGiven = NOT_GIVEN, fallback_voice_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, interruption_sensitivity: float | NotGiven = NOT_GIVEN, @@ -92,8 +91,10 @@ def create( "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -141,8 +142,7 @@ def create( | NotGiven = NOT_GIVEN, voice_speed: float | NotGiven = NOT_GIVEN, voice_temperature: float | NotGiven = NOT_GIVEN, - voicemail_detection_timeout_ms: int | NotGiven = NOT_GIVEN, - voicemail_message: str | NotGiven = NOT_GIVEN, + voicemail_option: Optional[agent_create_params.VoicemailOption] | NotGiven = NOT_GIVEN, volume: float | NotGiven = NOT_GIVEN, webhook_url: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -228,9 +228,6 @@ def create( false, will return transcripts in raw words. If not set, default value of true will apply. This currently only applies to English. - enable_voicemail_detection: If set to true, will detect whether the call enters a voicemail. Note that this - feature is only available for phone calls. - end_call_after_silence_ms: If users stay silent for a period after agent speech, end the call. The minimum value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). @@ -322,14 +319,10 @@ def create( this setting only applies to `11labs` voices. If unset, default value 1 will apply. - voicemail_detection_timeout_ms: Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). - - voicemail_message: The message to be played when the call enters a voicemail. Note that this - feature is only available for phone calls. If you want to hangup after hitting - voicemail, set this to empty string. + voicemail_option: If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. volume: If set, will control the volume of the agent. Value ranging from [0,2]. Lower value means quieter agent speech, while higher value means louder agent speech. @@ -365,7 +358,6 @@ def create( "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, "enable_transcription_formatting": enable_transcription_formatting, - "enable_voicemail_detection": enable_voicemail_detection, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -388,8 +380,7 @@ def create( "voice_model": voice_model, "voice_speed": voice_speed, "voice_temperature": voice_temperature, - "voicemail_detection_timeout_ms": voicemail_detection_timeout_ms, - "voicemail_message": voicemail_message, + "voicemail_option": voicemail_option, "volume": volume, "webhook_url": webhook_url, }, @@ -463,7 +454,6 @@ def update( | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, enable_transcription_formatting: bool | NotGiven = NOT_GIVEN, - enable_voicemail_detection: bool | NotGiven = NOT_GIVEN, end_call_after_silence_ms: int | NotGiven = NOT_GIVEN, fallback_voice_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, interruption_sensitivity: float | NotGiven = NOT_GIVEN, @@ -487,8 +477,10 @@ def update( "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -538,8 +530,7 @@ def update( | NotGiven = NOT_GIVEN, voice_speed: float | NotGiven = NOT_GIVEN, voice_temperature: float | NotGiven = NOT_GIVEN, - voicemail_detection_timeout_ms: int | NotGiven = NOT_GIVEN, - voicemail_message: str | NotGiven = NOT_GIVEN, + voicemail_option: Optional[agent_update_params.VoicemailOption] | NotGiven = NOT_GIVEN, volume: float | NotGiven = NOT_GIVEN, webhook_url: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -620,9 +611,6 @@ def update( false, will return transcripts in raw words. If not set, default value of true will apply. This currently only applies to English. - enable_voicemail_detection: If set to true, will detect whether the call enters a voicemail. Note that this - feature is only available for phone calls. - end_call_after_silence_ms: If users stay silent for a period after agent speech, end the call. The minimum value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). @@ -721,14 +709,10 @@ def update( this setting only applies to `11labs` voices. If unset, default value 1 will apply. - voicemail_detection_timeout_ms: Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). - - voicemail_message: The message to be played when the call enters a voicemail. Note that this - feature is only available for phone calls. If you want to hangup after hitting - voicemail, set this to empty string. + voicemail_option: If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. volume: If set, will control the volume of the agent. Value ranging from [0,2]. Lower value means quieter agent speech, while higher value means louder agent speech. @@ -764,7 +748,6 @@ def update( "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, "enable_transcription_formatting": enable_transcription_formatting, - "enable_voicemail_detection": enable_voicemail_detection, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -789,8 +772,7 @@ def update( "voice_model": voice_model, "voice_speed": voice_speed, "voice_temperature": voice_temperature, - "voicemail_detection_timeout_ms": voicemail_detection_timeout_ms, - "voicemail_message": voicemail_message, + "voicemail_option": voicemail_option, "volume": volume, "webhook_url": webhook_url, }, @@ -935,7 +917,6 @@ async def create( | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, enable_transcription_formatting: bool | NotGiven = NOT_GIVEN, - enable_voicemail_detection: bool | NotGiven = NOT_GIVEN, end_call_after_silence_ms: int | NotGiven = NOT_GIVEN, fallback_voice_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, interruption_sensitivity: float | NotGiven = NOT_GIVEN, @@ -959,8 +940,10 @@ async def create( "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -1008,8 +991,7 @@ async def create( | NotGiven = NOT_GIVEN, voice_speed: float | NotGiven = NOT_GIVEN, voice_temperature: float | NotGiven = NOT_GIVEN, - voicemail_detection_timeout_ms: int | NotGiven = NOT_GIVEN, - voicemail_message: str | NotGiven = NOT_GIVEN, + voicemail_option: Optional[agent_create_params.VoicemailOption] | NotGiven = NOT_GIVEN, volume: float | NotGiven = NOT_GIVEN, webhook_url: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1095,9 +1077,6 @@ async def create( false, will return transcripts in raw words. If not set, default value of true will apply. This currently only applies to English. - enable_voicemail_detection: If set to true, will detect whether the call enters a voicemail. Note that this - feature is only available for phone calls. - end_call_after_silence_ms: If users stay silent for a period after agent speech, end the call. The minimum value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). @@ -1189,14 +1168,10 @@ async def create( this setting only applies to `11labs` voices. If unset, default value 1 will apply. - voicemail_detection_timeout_ms: Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). - - voicemail_message: The message to be played when the call enters a voicemail. Note that this - feature is only available for phone calls. If you want to hangup after hitting - voicemail, set this to empty string. + voicemail_option: If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. volume: If set, will control the volume of the agent. Value ranging from [0,2]. Lower value means quieter agent speech, while higher value means louder agent speech. @@ -1232,7 +1207,6 @@ async def create( "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, "enable_transcription_formatting": enable_transcription_formatting, - "enable_voicemail_detection": enable_voicemail_detection, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -1255,8 +1229,7 @@ async def create( "voice_model": voice_model, "voice_speed": voice_speed, "voice_temperature": voice_temperature, - "voicemail_detection_timeout_ms": voicemail_detection_timeout_ms, - "voicemail_message": voicemail_message, + "voicemail_option": voicemail_option, "volume": volume, "webhook_url": webhook_url, }, @@ -1330,7 +1303,6 @@ async def update( | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, enable_transcription_formatting: bool | NotGiven = NOT_GIVEN, - enable_voicemail_detection: bool | NotGiven = NOT_GIVEN, end_call_after_silence_ms: int | NotGiven = NOT_GIVEN, fallback_voice_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, interruption_sensitivity: float | NotGiven = NOT_GIVEN, @@ -1354,8 +1326,10 @@ async def update( "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -1405,8 +1379,7 @@ async def update( | NotGiven = NOT_GIVEN, voice_speed: float | NotGiven = NOT_GIVEN, voice_temperature: float | NotGiven = NOT_GIVEN, - voicemail_detection_timeout_ms: int | NotGiven = NOT_GIVEN, - voicemail_message: str | NotGiven = NOT_GIVEN, + voicemail_option: Optional[agent_update_params.VoicemailOption] | NotGiven = NOT_GIVEN, volume: float | NotGiven = NOT_GIVEN, webhook_url: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1487,9 +1460,6 @@ async def update( false, will return transcripts in raw words. If not set, default value of true will apply. This currently only applies to English. - enable_voicemail_detection: If set to true, will detect whether the call enters a voicemail. Note that this - feature is only available for phone calls. - end_call_after_silence_ms: If users stay silent for a period after agent speech, end the call. The minimum value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). @@ -1588,14 +1558,10 @@ async def update( this setting only applies to `11labs` voices. If unset, default value 1 will apply. - voicemail_detection_timeout_ms: Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). - - voicemail_message: The message to be played when the call enters a voicemail. Note that this - feature is only available for phone calls. If you want to hangup after hitting - voicemail, set this to empty string. + voicemail_option: If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. volume: If set, will control the volume of the agent. Value ranging from [0,2]. Lower value means quieter agent speech, while higher value means louder agent speech. @@ -1631,7 +1597,6 @@ async def update( "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, "enable_transcription_formatting": enable_transcription_formatting, - "enable_voicemail_detection": enable_voicemail_detection, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -1656,8 +1621,7 @@ async def update( "voice_model": voice_model, "voice_speed": voice_speed, "voice_temperature": voice_temperature, - "voicemail_detection_timeout_ms": voicemail_detection_timeout_ms, - "voicemail_message": voicemail_message, + "voicemail_option": voicemail_option, "volume": volume, "webhook_url": webhook_url, }, diff --git a/src/retell/types/agent_create_params.py b/src/retell/types/agent_create_params.py index 096a2f82..e28fa8c2 100644 --- a/src/retell/types/agent_create_params.py +++ b/src/retell/types/agent_create_params.py @@ -18,6 +18,11 @@ "PostCallAnalysisDataNumberAnalysisData", "PronunciationDictionary", "UserDtmfOptions", + "VoicemailOption", + "VoicemailOptionAction", + "VoicemailOptionActionVoicemailActionPrompt", + "VoicemailOptionActionVoicemailActionStaticText", + "VoicemailOptionActionVoicemailActionHangup", ] @@ -132,12 +137,6 @@ class AgentCreateParams(TypedDict, total=False): of true will apply. This currently only applies to English. """ - enable_voicemail_detection: bool - """If set to true, will detect whether the call enters a voicemail. - - Note that this feature is only available for phone calls. - """ - end_call_after_silence_ms: int """If users stay silent for a period after agent speech, end the call. @@ -183,8 +182,10 @@ class AgentCreateParams(TypedDict, total=False): "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -340,19 +341,12 @@ class AgentCreateParams(TypedDict, total=False): voices. If unset, default value 1 will apply. """ - voicemail_detection_timeout_ms: int + voicemail_option: Optional[VoicemailOption] """ - Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). - """ - - voicemail_message: str - """The message to be played when the call enters a voicemail. - - Note that this feature is only available for phone calls. If you want to hangup - after hitting voicemail, set this to empty string. + If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. """ volume: float @@ -498,3 +492,35 @@ class UserDtmfOptions(TypedDict, total=False): The timer resets with each digit received. """ + + +class VoicemailOptionActionVoicemailActionPrompt(TypedDict, total=False): + text: Required[str] + """ + The prompt used to generate the text to be spoken when the call is detected to + be in voicemail. + """ + + type: Required[Literal["prompt"]] + + +class VoicemailOptionActionVoicemailActionStaticText(TypedDict, total=False): + text: Required[str] + """The text to be spoken when the call is detected to be in voicemail.""" + + type: Required[Literal["static_text"]] + + +class VoicemailOptionActionVoicemailActionHangup(TypedDict, total=False): + type: Required[Literal["hangup"]] + + +VoicemailOptionAction: TypeAlias = Union[ + VoicemailOptionActionVoicemailActionPrompt, + VoicemailOptionActionVoicemailActionStaticText, + VoicemailOptionActionVoicemailActionHangup, +] + + +class VoicemailOption(TypedDict, total=False): + action: Required[VoicemailOptionAction] diff --git a/src/retell/types/agent_response.py b/src/retell/types/agent_response.py index 0f9b0f71..1b9a0db8 100644 --- a/src/retell/types/agent_response.py +++ b/src/retell/types/agent_response.py @@ -18,6 +18,11 @@ "PostCallAnalysisDataNumberAnalysisData", "PronunciationDictionary", "UserDtmfOptions", + "VoicemailOption", + "VoicemailOptionAction", + "VoicemailOptionActionVoicemailActionPrompt", + "VoicemailOptionActionVoicemailActionStaticText", + "VoicemailOptionActionVoicemailActionHangup", ] @@ -149,6 +154,38 @@ class UserDtmfOptions(BaseModel): """ +class VoicemailOptionActionVoicemailActionPrompt(BaseModel): + text: str + """ + The prompt used to generate the text to be spoken when the call is detected to + be in voicemail. + """ + + type: Literal["prompt"] + + +class VoicemailOptionActionVoicemailActionStaticText(BaseModel): + text: str + """The text to be spoken when the call is detected to be in voicemail.""" + + type: Literal["static_text"] + + +class VoicemailOptionActionVoicemailActionHangup(BaseModel): + type: Literal["hangup"] + + +VoicemailOptionAction: TypeAlias = Union[ + VoicemailOptionActionVoicemailActionPrompt, + VoicemailOptionActionVoicemailActionStaticText, + VoicemailOptionActionVoicemailActionHangup, +] + + +class VoicemailOption(BaseModel): + action: VoicemailOptionAction + + class AgentResponse(BaseModel): agent_id: str """Unique id of agent.""" @@ -269,12 +306,6 @@ class AgentResponse(BaseModel): of true will apply. This currently only applies to English. """ - enable_voicemail_detection: Optional[bool] = None - """If set to true, will detect whether the call enters a voicemail. - - Note that this feature is only available for phone calls. - """ - end_call_after_silence_ms: Optional[int] = None """If users stay silent for a period after agent speech, end the call. @@ -324,8 +355,10 @@ class AgentResponse(BaseModel): "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -482,19 +515,12 @@ class AgentResponse(BaseModel): voices. If unset, default value 1 will apply. """ - voicemail_detection_timeout_ms: Optional[int] = None - """ - Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). + voicemail_option: Optional[VoicemailOption] = None """ - - voicemail_message: Optional[str] = None - """The message to be played when the call enters a voicemail. - - Note that this feature is only available for phone calls. If you want to hangup - after hitting voicemail, set this to empty string. + If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. """ volume: Optional[float] = None diff --git a/src/retell/types/agent_update_params.py b/src/retell/types/agent_update_params.py index c5ab8b0c..be9cf480 100644 --- a/src/retell/types/agent_update_params.py +++ b/src/retell/types/agent_update_params.py @@ -20,6 +20,11 @@ "ResponseEngineResponseEngineCustomLm", "ResponseEngineResponseEngineConversationFlow", "UserDtmfOptions", + "VoicemailOption", + "VoicemailOptionAction", + "VoicemailOptionActionVoicemailActionPrompt", + "VoicemailOptionActionVoicemailActionStaticText", + "VoicemailOptionActionVoicemailActionHangup", ] @@ -124,12 +129,6 @@ class AgentUpdateParams(TypedDict, total=False): of true will apply. This currently only applies to English. """ - enable_voicemail_detection: bool - """If set to true, will detect whether the call enters a voicemail. - - Note that this feature is only available for phone calls. - """ - end_call_after_silence_ms: int """If users stay silent for a period after agent speech, end the call. @@ -175,8 +174,10 @@ class AgentUpdateParams(TypedDict, total=False): "it-IT", "ko-KR", "nl-NL", + "nl-BE", "pl-PL", "tr-TR", + "th-TH", "vi-VN", "ro-RO", "bg-BG", @@ -345,19 +346,12 @@ class AgentUpdateParams(TypedDict, total=False): voices. If unset, default value 1 will apply. """ - voicemail_detection_timeout_ms: int + voicemail_option: Optional[VoicemailOption] """ - Configures when to stop running voicemail detection, as it becomes unlikely to - hit voicemail after a couple minutes, and keep running it will only have - negative impact. The minimum value allowed is 5,000 ms (5 s), and maximum value - allowed is 180,000 (3 minutes). By default, this is set to 30,000 (30 s). - """ - - voicemail_message: str - """The message to be played when the call enters a voicemail. - - Note that this feature is only available for phone calls. If you want to hangup - after hitting voicemail, set this to empty string. + If this option is set, the call will try to detect voicemail in the first 3 + minutes of the call. Actions defined (hangup, or leave a message) will be + applied when the voicemail is detected. Set this to null to disable voicemail + detection. """ volume: float @@ -503,3 +497,35 @@ class UserDtmfOptions(TypedDict, total=False): The timer resets with each digit received. """ + + +class VoicemailOptionActionVoicemailActionPrompt(TypedDict, total=False): + text: Required[str] + """ + The prompt used to generate the text to be spoken when the call is detected to + be in voicemail. + """ + + type: Required[Literal["prompt"]] + + +class VoicemailOptionActionVoicemailActionStaticText(TypedDict, total=False): + text: Required[str] + """The text to be spoken when the call is detected to be in voicemail.""" + + type: Required[Literal["static_text"]] + + +class VoicemailOptionActionVoicemailActionHangup(TypedDict, total=False): + type: Required[Literal["hangup"]] + + +VoicemailOptionAction: TypeAlias = Union[ + VoicemailOptionActionVoicemailActionPrompt, + VoicemailOptionActionVoicemailActionStaticText, + VoicemailOptionActionVoicemailActionHangup, +] + + +class VoicemailOption(TypedDict, total=False): + action: Required[VoicemailOptionAction] diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index 54bf8204..f2823319 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -52,7 +52,6 @@ def test_method_create_with_all_params(self, client: Retell) -> None: denoising_mode="noise-cancellation", enable_backchannel=True, enable_transcription_formatting=True, - enable_voicemail_detection=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -92,8 +91,12 @@ def test_method_create_with_all_params(self, client: Retell) -> None: voice_model="eleven_turbo_v2", voice_speed=1, voice_temperature=1, - voicemail_detection_timeout_ms=30000, - voicemail_message="Hi, please give us a callback.", + voicemail_option={ + "action": { + "text": "Please give us a callback tomorrow at 10am.", + "type": "static_text", + } + }, volume=1, webhook_url="https://webhook-url-here", ) @@ -200,7 +203,6 @@ def test_method_update_with_all_params(self, client: Retell) -> None: denoising_mode="noise-cancellation", enable_backchannel=True, enable_transcription_formatting=True, - enable_voicemail_detection=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -246,8 +248,12 @@ def test_method_update_with_all_params(self, client: Retell) -> None: voice_model="eleven_turbo_v2", voice_speed=1, voice_temperature=1, - voicemail_detection_timeout_ms=30000, - voicemail_message="Hi, please give us a callback.", + voicemail_option={ + "action": { + "text": "Please give us a callback tomorrow at 10am.", + "type": "static_text", + } + }, volume=1, webhook_url="https://webhook-url-here", ) @@ -420,7 +426,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> denoising_mode="noise-cancellation", enable_backchannel=True, enable_transcription_formatting=True, - enable_voicemail_detection=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -460,8 +465,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> voice_model="eleven_turbo_v2", voice_speed=1, voice_temperature=1, - voicemail_detection_timeout_ms=30000, - voicemail_message="Hi, please give us a callback.", + voicemail_option={ + "action": { + "text": "Please give us a callback tomorrow at 10am.", + "type": "static_text", + } + }, volume=1, webhook_url="https://webhook-url-here", ) @@ -568,7 +577,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> denoising_mode="noise-cancellation", enable_backchannel=True, enable_transcription_formatting=True, - enable_voicemail_detection=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -614,8 +622,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> voice_model="eleven_turbo_v2", voice_speed=1, voice_temperature=1, - voicemail_detection_timeout_ms=30000, - voicemail_message="Hi, please give us a callback.", + voicemail_option={ + "action": { + "text": "Please give us a callback tomorrow at 10am.", + "type": "static_text", + } + }, volume=1, webhook_url="https://webhook-url-here", ) From bd8d30a2c8eec6984cdc8c18c33b39a5190aba65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 19:29:32 +0000 Subject: [PATCH 6/6] release: 4.35.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 20 ++++++++++++++++++++ pyproject.toml | 2 +- src/retell/_version.py | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7dc692e1..25e9535f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.34.0" + ".": "4.35.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b97bc36..d253d3a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 4.35.0 (2025-06-13) + +Full Changelog: [v4.34.0...v4.35.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.34.0...v4.35.0) + +### Features + +* **api:** api update ([cd5addb](https://github.com/RetellAI/retell-python-sdk/commit/cd5addb4641d3c136faf19b5b500f20d17ff0e6c)) +* **api:** api update ([d56f39e](https://github.com/RetellAI/retell-python-sdk/commit/d56f39e79341c0af2e54d68aea298465ae9c290b)) +* **api:** api update ([abd1558](https://github.com/RetellAI/retell-python-sdk/commit/abd155800da17746a7617342f7f85c40c70d48fe)) + + +### Bug Fixes + +* **client:** correctly parse binary response | stream ([6ea3bc6](https://github.com/RetellAI/retell-python-sdk/commit/6ea3bc69ddc6e5852a1563a232a427d980f03128)) + + +### Chores + +* **tests:** run tests in parallel ([0e2b1e4](https://github.com/RetellAI/retell-python-sdk/commit/0e2b1e44f3a3e6cd044bfd66d0fe6c1b4a1dfa54)) + ## 4.34.0 (2025-06-11) Full Changelog: [v4.33.0...v4.34.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.33.0...v4.34.0) diff --git a/pyproject.toml b/pyproject.toml index 88d58bf2..22517bab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "retell-sdk" -version = "4.34.0" +version = "4.35.0" description = "The official Python library for the retell API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/retell/_version.py b/src/retell/_version.py index 93410b42..f199cb41 100644 --- a/src/retell/_version.py +++ b/src/retell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "retell" -__version__ = "4.34.0" # x-release-please-version +__version__ = "4.35.0" # x-release-please-version