From f055bdf00ae2ab8d39684fd7674ac04845858170 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:21:45 +0000 Subject: [PATCH 01/22] chore(tests): add tests for httpx client instantiation & proxies --- tests/test_client.py | 53 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index 528a649c..a5d87f15 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -27,7 +27,14 @@ from retell._models import BaseModel, FinalRequestOptions from retell._constants import RAW_RESPONSE_HEADER from retell._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError -from retell._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options +from retell._base_client import ( + DEFAULT_TIMEOUT, + HTTPX_DEFAULT_TIMEOUT, + BaseClient, + DefaultHttpxClient, + DefaultAsyncHttpxClient, + make_request_options, +) from retell.types.agent_create_params import AgentCreateParams from .utils import update_env @@ -846,6 +853,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects @@ -1732,6 +1761,28 @@ async def test_main() -> None: time.sleep(0.1) + async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultAsyncHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + async def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultAsyncHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) async def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects From 56ff61e8c2a353faf6b668d40b7ea96d57576789 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 19:01:14 +0000 Subject: [PATCH 02/22] chore(internal): update conftest.py --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 360deb5e..8977d28a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + from __future__ import annotations import os From 3255f4a2a7e57ae4dfc3e704c1895ca76d6eaeb4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 00:12:33 +0000 Subject: [PATCH 03/22] chore(ci): enable for pull requests --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3576973..2cf368ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: From faaed6a89f513e4de848ca569140f15989ec84f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 14:55:13 +0000 Subject: [PATCH 04/22] chore(readme): update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72084bde..27f20781 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Retell Python API library -[![PyPI version](https://img.shields.io/pypi/v/retell-sdk.svg)](https://pypi.org/project/retell-sdk/) +[![PyPI version]()](https://pypi.org/project/retell-sdk/) The Retell Python library provides convenient access to the Retell REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From 82eb66606315b29827250d1db55cbc8d1201a770 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:13:55 +0000 Subject: [PATCH 05/22] fix(tests): fix: tests which call HTTP endpoints directly with the example parameters --- tests/test_client.py | 113 ++++++++++++------------------------------- 1 file changed, 32 insertions(+), 81 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index a5d87f15..2d61949f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,9 +23,7 @@ from retell import Retell, AsyncRetell, APIResponseValidationError from retell._types import Omit -from retell._utils import maybe_transform from retell._models import BaseModel, FinalRequestOptions -from retell._constants import RAW_RESPONSE_HEADER from retell._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError from retell._base_client import ( DEFAULT_TIMEOUT, @@ -35,7 +33,6 @@ DefaultAsyncHttpxClient, make_request_options, ) -from retell.types.agent_create_params import AgentCreateParams from .utils import update_env @@ -704,56 +701,33 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("retell._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Retell) -> None: respx_mock.post("/create-agent").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - self.client.post( - "/create-agent", - body=cast( - object, - maybe_transform( - dict( - response_engine={ - "llm_id": "llm_234sdertfsdsfsdf", - "type": "retell-llm", - }, - voice_id="11labs-Adrian", - ), - AgentCreateParams, - ), - ), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + client.agent.with_streaming_response.create( + response_engine={ + "llm_id": "llm_234sdertfsdsfsdf", + "type": "retell-llm", + }, + voice_id="11labs-Adrian", + ).__enter__() assert _get_open_connections(self.client) == 0 @mock.patch("retell._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Retell) -> None: respx_mock.post("/create-agent").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - self.client.post( - "/create-agent", - body=cast( - object, - maybe_transform( - dict( - response_engine={ - "llm_id": "llm_234sdertfsdsfsdf", - "type": "retell-llm", - }, - voice_id="11labs-Adrian", - ), - AgentCreateParams, - ), - ), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) - + client.agent.with_streaming_response.create( + response_engine={ + "llm_id": "llm_234sdertfsdsfsdf", + "type": "retell-llm", + }, + voice_id="11labs-Adrian", + ).__enter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1564,56 +1538,33 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("retell._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncRetell) -> None: respx_mock.post("/create-agent").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await self.client.post( - "/create-agent", - body=cast( - object, - maybe_transform( - dict( - response_engine={ - "llm_id": "llm_234sdertfsdsfsdf", - "type": "retell-llm", - }, - voice_id="11labs-Adrian", - ), - AgentCreateParams, - ), - ), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + await async_client.agent.with_streaming_response.create( + response_engine={ + "llm_id": "llm_234sdertfsdsfsdf", + "type": "retell-llm", + }, + voice_id="11labs-Adrian", + ).__aenter__() assert _get_open_connections(self.client) == 0 @mock.patch("retell._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncRetell) -> None: respx_mock.post("/create-agent").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await self.client.post( - "/create-agent", - body=cast( - object, - maybe_transform( - dict( - response_engine={ - "llm_id": "llm_234sdertfsdsfsdf", - "type": "retell-llm", - }, - voice_id="11labs-Adrian", - ), - AgentCreateParams, - ), - ), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) - + await async_client.agent.with_streaming_response.create( + response_engine={ + "llm_id": "llm_234sdertfsdsfsdf", + "type": "retell-llm", + }, + voice_id="11labs-Adrian", + ).__aenter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) From bbbf5ceee0d1f5ea5578fe22d5a5046afd17e925 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 12:43:45 +0000 Subject: [PATCH 06/22] docs(client): fix httpx.Timeout documentation reference --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27f20781..b8e7958d 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ client.with_options(max_retries=5).agent.create( ### Timeouts By default requests time out after 1 minute. You can configure this with a `timeout` option, -which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python from retell import Retell From 15b8af3658b36e040a21fc5be3c28d2e3a45bf79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:23:10 +0000 Subject: [PATCH 07/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/types/llm_create_params.py | 6 ++++++ src/retell/types/llm_response.py | 6 ++++++ src/retell/types/llm_update_params.py | 6 ++++++ src/retell/types/phone_call_response.py | 3 +++ src/retell/types/web_call_response.py | 3 +++ tests/api_resources/test_llm.py | 4 ++++ 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 20f60d86..28d6e5f1 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-56f2d45e8cd73d9affbc60ffb07513d0ac62f19631854d3f376d066969f71bad.yml -openapi_spec_hash: ab9dac6b50dd93a8ef459e6e68660bac +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-e5083b2f032866fda76d065d2fe84e311179983d7d5c8ad15b9f81b5a42e83e8.yml +openapi_spec_hash: 0a1053994130c03be2d53a934d3adea6 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/types/llm_create_params.py b/src/retell/types/llm_create_params.py index a045b76a..4d29a063 100644 --- a/src/retell/types/llm_create_params.py +++ b/src/retell/types/llm_create_params.py @@ -265,6 +265,9 @@ class GeneralToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when @@ -638,6 +641,9 @@ class StateToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/llm_response.py b/src/retell/types/llm_response.py index a58a9a55..1f1c554b 100644 --- a/src/retell/types/llm_response.py +++ b/src/retell/types/llm_response.py @@ -168,6 +168,9 @@ class GeneralToolTransferCallTool(BaseModel): type: Literal["transfer_call"] + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + description: Optional[str] = None """ Describes what the tool does, sometimes can also include information about when @@ -541,6 +544,9 @@ class StateToolTransferCallTool(BaseModel): type: Literal["transfer_call"] + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + description: Optional[str] = None """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/llm_update_params.py b/src/retell/types/llm_update_params.py index ef7cf682..5d633d76 100644 --- a/src/retell/types/llm_update_params.py +++ b/src/retell/types/llm_update_params.py @@ -270,6 +270,9 @@ class GeneralToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when @@ -643,6 +646,9 @@ class StateToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/phone_call_response.py b/src/retell/types/phone_call_response.py index 7c5b999c..76c70531 100644 --- a/src/retell/types/phone_call_response.py +++ b/src/retell/types/phone_call_response.py @@ -457,6 +457,9 @@ class PhoneCallResponse(BaseModel): collected_dynamic_variables: Optional[Dict[str, object]] = None """Dynamic variables collected from the call. Only available after the call ends.""" + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + disconnection_reason: Optional[ Literal[ "user_hangup", diff --git a/src/retell/types/web_call_response.py b/src/retell/types/web_call_response.py index bbaee969..e7243f25 100644 --- a/src/retell/types/web_call_response.py +++ b/src/retell/types/web_call_response.py @@ -448,6 +448,9 @@ class WebCallResponse(BaseModel): collected_dynamic_variables: Optional[Dict[str, object]] = None """Dynamic variables collected from the call. Only available after the call ends.""" + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + disconnection_reason: Optional[ Literal[ "user_hangup", diff --git a/tests/api_resources/test_llm.py b/tests/api_resources/test_llm.py index a2aef83a..3433df68 100644 --- a/tests/api_resources/test_llm.py +++ b/tests/api_resources/test_llm.py @@ -68,6 +68,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"foo": "string"}, "description": "Transfer to the support team.", } ], @@ -224,6 +225,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"foo": "string"}, "description": "Transfer to the support team.", } ], @@ -408,6 +410,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"foo": "string"}, "description": "Transfer to the support team.", } ], @@ -564,6 +567,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"foo": "string"}, "description": "Transfer to the support team.", } ], From e33361bc15fc80a3fcbb9be089742f7dfda7568b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:36:26 +0000 Subject: [PATCH 08/22] feat(api): api update --- .stats.yml | 4 ++-- tests/api_resources/test_llm.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 28d6e5f1..99c08767 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-e5083b2f032866fda76d065d2fe84e311179983d7d5c8ad15b9f81b5a42e83e8.yml -openapi_spec_hash: 0a1053994130c03be2d53a934d3adea6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-2bae751c1721d107f0e89d699513c696cdf8a7c5ee3ce3f1021e3058705639df.yml +openapi_spec_hash: bcae7c7dd5b8b5c4782f951e4b29c883 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/tests/api_resources/test_llm.py b/tests/api_resources/test_llm.py index 3433df68..6a4317ce 100644 --- a/tests/api_resources/test_llm.py +++ b/tests/api_resources/test_llm.py @@ -68,7 +68,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"foo": "string"}, + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -225,7 +225,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"foo": "string"}, + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -410,7 +410,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"foo": "string"}, + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -567,7 +567,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"foo": "string"}, + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], From 3600f4cf8833658591ef72e58e33df57dc223eb4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 17:41:12 +0000 Subject: [PATCH 09/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/resources/call.py | 8 ++++++++ src/retell/types/call_create_phone_call_params.py | 3 +++ tests/api_resources/test_call.py | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 99c08767..7d1bd10e 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-2bae751c1721d107f0e89d699513c696cdf8a7c5ee3ce3f1021e3058705639df.yml -openapi_spec_hash: bcae7c7dd5b8b5c4782f951e4b29c883 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-ff0593bff503537749d73b5e17a292fcc387c66b9f35869fbda199802db0943b.yml +openapi_spec_hash: 37251718c2769f4e5946007dffe362f8 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/resources/call.py b/src/retell/resources/call.py index ded37327..13881c65 100644 --- a/src/retell/resources/call.py +++ b/src/retell/resources/call.py @@ -236,6 +236,7 @@ def create_phone_call( *, from_number: str, to_number: str, + custom_sip_headers: Dict[str, str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, override_agent_id: str | NotGiven = NOT_GIVEN, override_agent_version: int | NotGiven = NOT_GIVEN, @@ -257,6 +258,8 @@ def create_phone_call( to_number: The number you want to call, in E.164 format. If using a number purchased from Retell, only US numbers are supported as destination. + custom_sip_headers: Add optional custom SIP headers to the call. + metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the call. Not used for processing. You can later get this field from the call object. @@ -286,6 +289,7 @@ def create_phone_call( { "from_number": from_number, "to_number": to_number, + "custom_sip_headers": custom_sip_headers, "metadata": metadata, "override_agent_id": override_agent_id, "override_agent_version": override_agent_version, @@ -627,6 +631,7 @@ async def create_phone_call( *, from_number: str, to_number: str, + custom_sip_headers: Dict[str, str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, override_agent_id: str | NotGiven = NOT_GIVEN, override_agent_version: int | NotGiven = NOT_GIVEN, @@ -648,6 +653,8 @@ async def create_phone_call( to_number: The number you want to call, in E.164 format. If using a number purchased from Retell, only US numbers are supported as destination. + custom_sip_headers: Add optional custom SIP headers to the call. + metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the call. Not used for processing. You can later get this field from the call object. @@ -677,6 +684,7 @@ async def create_phone_call( { "from_number": from_number, "to_number": to_number, + "custom_sip_headers": custom_sip_headers, "metadata": metadata, "override_agent_id": override_agent_id, "override_agent_version": override_agent_version, diff --git a/src/retell/types/call_create_phone_call_params.py b/src/retell/types/call_create_phone_call_params.py index 5306274e..474bebce 100644 --- a/src/retell/types/call_create_phone_call_params.py +++ b/src/retell/types/call_create_phone_call_params.py @@ -22,6 +22,9 @@ class CallCreatePhoneCallParams(TypedDict, total=False): destination. """ + custom_sip_headers: Dict[str, str] + """Add optional custom SIP headers to the call.""" + metadata: object """An arbitrary object for storage purpose only. diff --git a/tests/api_resources/test_call.py b/tests/api_resources/test_call.py index c5101e9b..58e33f68 100644 --- a/tests/api_resources/test_call.py +++ b/tests/api_resources/test_call.py @@ -220,6 +220,7 @@ def test_method_create_phone_call_with_all_params(self, client: Retell) -> None: call = client.call.create_phone_call( from_number="+14157774444", to_number="+12137774445", + custom_sip_headers={"X-Custom-Header": "Custom Value"}, metadata={}, override_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", override_agent_version=1, @@ -540,6 +541,7 @@ async def test_method_create_phone_call_with_all_params(self, async_client: Asyn call = await async_client.call.create_phone_call( from_number="+14157774444", to_number="+12137774445", + custom_sip_headers={"X-Custom-Header": "Custom Value"}, metadata={}, override_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", override_agent_version=1, From c3c2840e285d73c451f0a4e18ffcdf6d7bdff06a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 18:06:57 +0000 Subject: [PATCH 10/22] feat(client): add support for aiohttp --- README.md | 37 +++++++++++++++++++ pyproject.toml | 2 + requirements-dev.lock | 27 ++++++++++++++ requirements.lock | 27 ++++++++++++++ src/retell/__init__.py | 3 +- src/retell/_base_client.py | 22 +++++++++++ tests/api_resources/test_agent.py | 4 +- tests/api_resources/test_batch_call.py | 4 +- tests/api_resources/test_call.py | 4 +- tests/api_resources/test_chat.py | 4 +- tests/api_resources/test_concurrency.py | 4 +- tests/api_resources/test_knowledge_base.py | 4 +- tests/api_resources/test_llm.py | 4 +- tests/api_resources/test_phone_number.py | 4 +- tests/api_resources/test_voice.py | 4 +- tests/conftest.py | 43 +++++++++++++++++++--- 16 files changed, 181 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b8e7958d..5f1821c3 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,43 @@ asyncio.run(main()) Functionality between the synchronous and asynchronous clients is otherwise identical. +### With aiohttp + +By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend. + +You can enable this by installing `aiohttp`: + +```sh +# install from PyPI +pip install retell-sdk[aiohttp] +``` + +Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: + +```python +import asyncio +from retell import DefaultAioHttpClient +from retell import AsyncRetell + + +async def main() -> None: + async with AsyncRetell( + api_key="YOUR_RETELL_API_KEY", + http_client=DefaultAioHttpClient(), + ) as client: + agent_response = await client.agent.create( + response_engine={ + "llm_id": "llm_234sdertfsdsfsdf", + "type": "retell-llm", + }, + voice_id="11labs-Adrian", + ) + print(agent_response.agent_id) + + +asyncio.run(main()) +``` + ## Using types Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: diff --git a/pyproject.toml b/pyproject.toml index 29d7bd61..2b5faae9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,8 @@ classifiers = [ Homepage = "https://github.com/RetellAI/retell-python-sdk" Repository = "https://github.com/RetellAI/retell-python-sdk" +[project.optional-dependencies] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index e3931d8f..78a895e4 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,6 +10,13 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.13 + # via httpx-aiohttp + # via retell-sdk +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 @@ -17,6 +24,10 @@ anyio==4.4.0 # via retell-sdk argcomplete==3.1.2 # via nox +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -38,16 +49,23 @@ execnet==2.1.1 # via pytest-xdist filelock==3.12.4 # via virtualenv +frozenlist==1.7.0 + # via aiohttp + # via aiosignal h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx httpx==0.28.1 + # via httpx-aiohttp # via respx # via retell-sdk +httpx-aiohttp==0.1.6 + # via retell-sdk idna==3.4 # via anyio # via httpx + # via yarl importlib-metadata==7.0.0 iniconfig==2.0.0 # via pytest @@ -55,6 +73,9 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py +multidict==6.5.0 + # via aiohttp + # via yarl mypy==1.14.1 mypy-extensions==1.0.0 # via mypy @@ -69,6 +90,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest +propcache==0.3.2 + # via aiohttp + # via yarl pycparser==2.22 # via cffi pydantic==2.10.3 @@ -103,6 +127,7 @@ tomli==2.0.2 # via pytest typing-extensions==4.12.2 # via anyio + # via multidict # via mypy # via pydantic # via pydantic-core @@ -110,5 +135,7 @@ typing-extensions==4.12.2 # via retell-sdk virtualenv==20.24.5 # via nox +yarl==1.20.1 + # via aiohttp zipp==3.17.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 0a7411a7..5f96672c 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,11 +10,22 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.13 + # via httpx-aiohttp + # via retell-sdk +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via httpx # via retell-sdk +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -26,15 +37,28 @@ distro==1.8.0 # via retell-sdk exceptiongroup==1.2.2 # via anyio +frozenlist==1.7.0 + # via aiohttp + # via aiosignal h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx httpx==0.28.1 + # via httpx-aiohttp + # via retell-sdk +httpx-aiohttp==0.1.6 # via retell-sdk idna==3.4 # via anyio # via httpx + # via yarl +multidict==6.5.0 + # via aiohttp + # via yarl +propcache==0.3.2 + # via aiohttp + # via yarl pycparser==2.22 # via cffi pydantic==2.10.3 @@ -46,6 +70,9 @@ sniffio==1.3.0 # via retell-sdk typing-extensions==4.12.2 # via anyio + # via multidict # via pydantic # via pydantic-core # via retell-sdk +yarl==1.20.1 + # via aiohttp diff --git a/src/retell/__init__.py b/src/retell/__init__.py index c5ddb67e..bc4b3289 100644 --- a/src/retell/__init__.py +++ b/src/retell/__init__.py @@ -26,7 +26,7 @@ UnprocessableEntityError, APIResponseValidationError, ) -from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging __all__ = [ @@ -68,6 +68,7 @@ "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient", + "DefaultAioHttpClient", ] if not _t.TYPE_CHECKING: diff --git a/src/retell/_base_client.py b/src/retell/_base_client.py index 6a8c6fc3..ba8385ad 100644 --- a/src/retell/_base_client.py +++ b/src/retell/_base_client.py @@ -1284,6 +1284,24 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) +try: + import httpx_aiohttp +except ImportError: + + class _DefaultAioHttpClient(httpx.AsyncClient): + def __init__(self, **_kwargs: Any) -> None: + raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra") +else: + + class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + + super().__init__(**kwargs) + + if TYPE_CHECKING: DefaultAsyncHttpxClient = httpx.AsyncClient """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK @@ -1292,8 +1310,12 @@ def __init__(self, **kwargs: Any) -> None: This is useful because overriding the `http_client` with your own instance of `httpx.AsyncClient` will result in httpx's defaults being used, not ours. """ + + DefaultAioHttpClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`.""" else: DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + DefaultAioHttpClient = _DefaultAioHttpClient class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index 896161a3..f5772977 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -391,7 +391,9 @@ def test_path_params_get_versions(self, client: Retell) -> None: class TestAsyncAgent: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_batch_call.py b/tests/api_resources/test_batch_call.py index 92ce0715..86dd214a 100644 --- a/tests/api_resources/test_batch_call.py +++ b/tests/api_resources/test_batch_call.py @@ -68,7 +68,9 @@ def test_streaming_response_create_batch_call(self, client: Retell) -> None: class TestAsyncBatchCall: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create_batch_call(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_call.py b/tests/api_resources/test_call.py index 58e33f68..fdd6772f 100644 --- a/tests/api_resources/test_call.py +++ b/tests/api_resources/test_call.py @@ -341,7 +341,9 @@ def test_streaming_response_register_phone_call(self, client: Retell) -> None: class TestAsyncCall: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_retrieve(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_chat.py b/tests/api_resources/test_chat.py index 67c52f1e..191510c7 100644 --- a/tests/api_resources/test_chat.py +++ b/tests/api_resources/test_chat.py @@ -199,7 +199,9 @@ def test_path_params_end(self, client: Retell) -> None: class TestAsyncChat: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_concurrency.py b/tests/api_resources/test_concurrency.py index ad2e7353..0ddda51c 100644 --- a/tests/api_resources/test_concurrency.py +++ b/tests/api_resources/test_concurrency.py @@ -44,7 +44,9 @@ def test_streaming_response_retrieve(self, client: Retell) -> None: class TestAsyncConcurrency: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_retrieve(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_knowledge_base.py b/tests/api_resources/test_knowledge_base.py index 234e4f5c..1a50a3b0 100644 --- a/tests/api_resources/test_knowledge_base.py +++ b/tests/api_resources/test_knowledge_base.py @@ -280,7 +280,9 @@ def test_path_params_delete_source(self, client: Retell) -> None: class TestAsyncKnowledgeBase: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip(reason="custom code") @parametrize diff --git a/tests/api_resources/test_llm.py b/tests/api_resources/test_llm.py index 6a4317ce..968fa6c6 100644 --- a/tests/api_resources/test_llm.py +++ b/tests/api_resources/test_llm.py @@ -357,7 +357,9 @@ def test_path_params_delete(self, client: Retell) -> None: class TestAsyncLlm: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_phone_number.py b/tests/api_resources/test_phone_number.py index 8da86b96..d039e790 100644 --- a/tests/api_resources/test_phone_number.py +++ b/tests/api_resources/test_phone_number.py @@ -263,7 +263,9 @@ def test_streaming_response_import(self, client: Retell) -> None: class TestAsyncPhoneNumber: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRetell) -> None: diff --git a/tests/api_resources/test_voice.py b/tests/api_resources/test_voice.py index 03ecc8be..06a6e7d1 100644 --- a/tests/api_resources/test_voice.py +++ b/tests/api_resources/test_voice.py @@ -82,7 +82,9 @@ def test_streaming_response_list(self, client: Retell) -> None: class TestAsyncVoice: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_retrieve(self, async_client: AsyncRetell) -> None: diff --git a/tests/conftest.py b/tests/conftest.py index 8977d28a..5c1b1500 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,10 +6,12 @@ import logging from typing import TYPE_CHECKING, Iterator, AsyncIterator +import httpx import pytest from pytest_asyncio import is_async_test -from retell import Retell, AsyncRetell +from retell import Retell, AsyncRetell, DefaultAioHttpClient +from retell._utils import is_dict if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] @@ -27,6 +29,19 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: for async_test in pytest_asyncio_tests: async_test.add_marker(session_scope_marker, append=False) + # We skip tests that use both the aiohttp client and respx_mock as respx_mock + # doesn't support custom transports. + for item in items: + if "async_client" not in item.fixturenames or "respx_mock" not in item.fixturenames: + continue + + if not hasattr(item, "callspec"): + continue + + async_client_param = item.callspec.params.get("async_client") + if is_dict(async_client_param) and async_client_param.get("http_client") == "aiohttp": + item.add_marker(pytest.mark.skip(reason="aiohttp client is not compatible with respx_mock")) + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -45,9 +60,25 @@ def client(request: FixtureRequest) -> Iterator[Retell]: @pytest.fixture(scope="session") async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncRetell]: - strict = getattr(request, "param", True) - if not isinstance(strict, bool): - raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - - async with AsyncRetell(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: + param = getattr(request, "param", True) + + # defaults + strict = True + http_client: None | httpx.AsyncClient = None + + if isinstance(param, bool): + strict = param + elif is_dict(param): + strict = param.get("strict", True) + assert isinstance(strict, bool) + + http_client_type = param.get("http_client", "httpx") + if http_client_type == "aiohttp": + http_client = DefaultAioHttpClient() + else: + raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict") + + async with AsyncRetell( + base_url=base_url, api_key=api_key, _strict_response_validation=strict, http_client=http_client + ) as client: yield client From 2a5ba8bd792e3c10ec7ac0ca5025f300a06fe311 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 22 Jun 2025 21:10:21 +0000 Subject: [PATCH 11/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/resources/chat.py | 6 ++++-- src/retell/types/chat_create_params.py | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7d1bd10e..bd8db06c 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-ff0593bff503537749d73b5e17a292fcc387c66b9f35869fbda199802db0943b.yml -openapi_spec_hash: 37251718c2769f4e5946007dffe362f8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-dd35830e02cb8b31b4345fa30aa0ba0ef6c4d21071072d552c845f463d955619.yml +openapi_spec_hash: 6931390d0e083d8d3346dbbbe01a161b config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/resources/chat.py b/src/retell/resources/chat.py index 0589378a..99af968c 100644 --- a/src/retell/resources/chat.py +++ b/src/retell/resources/chat.py @@ -65,7 +65,8 @@ def create( Args: agent_id: The chat agent to use for the call. - agent_version: The version of the chat agent to use for the call. + agent_version: The version of the chat agent to use for the call. If not provided, will default + to latest version. metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You @@ -270,7 +271,8 @@ async def create( Args: agent_id: The chat agent to use for the call. - agent_version: The version of the chat agent to use for the call. + agent_version: The version of the chat agent to use for the call. If not provided, will default + to latest version. metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You diff --git a/src/retell/types/chat_create_params.py b/src/retell/types/chat_create_params.py index 61a59ae9..33503f19 100644 --- a/src/retell/types/chat_create_params.py +++ b/src/retell/types/chat_create_params.py @@ -13,7 +13,10 @@ class ChatCreateParams(TypedDict, total=False): """The chat agent to use for the call.""" agent_version: int - """The version of the chat agent to use for the call.""" + """The version of the chat agent to use for the call. + + If not provided, will default to latest version. + """ metadata: object """An arbitrary object for storage purpose only. From 827320564ec4a33ce33e5b30ca155dd83fb3f324 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 18:52:27 +0000 Subject: [PATCH 12/22] chore(tests): skip some failing tests on the latest python versions --- tests/test_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 2d61949f..01d76010 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -191,6 +191,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") @@ -1012,6 +1013,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") From 0703f822fa8c51efe5cb0ca70174d8dacadc985a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 22:57:58 +0000 Subject: [PATCH 13/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/resources/agent.py | 24 +++++++++++++++++++ src/retell/resources/call.py | 8 ------- src/retell/resources/chat.py | 6 ++--- src/retell/types/agent_create_params.py | 7 ++++++ src/retell/types/agent_response.py | 7 ++++++ src/retell/types/agent_update_params.py | 7 ++++++ .../types/call_create_phone_call_params.py | 3 --- src/retell/types/chat_create_params.py | 5 +--- src/retell/types/llm_create_params.py | 6 ----- src/retell/types/llm_response.py | 6 ----- src/retell/types/llm_update_params.py | 6 ----- src/retell/types/phone_call_response.py | 3 --- src/retell/types/web_call_response.py | 3 --- tests/api_resources/test_agent.py | 4 ++++ tests/api_resources/test_call.py | 2 -- tests/api_resources/test_llm.py | 4 ---- 17 files changed, 54 insertions(+), 51 deletions(-) diff --git a/.stats.yml b/.stats.yml index bd8db06c..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-dd35830e02cb8b31b4345fa30aa0ba0ef6c4d21071072d552c845f463d955619.yml -openapi_spec_hash: 6931390d0e083d8d3346dbbbe01a161b +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 fa4f044c..dcc91dee 100644 --- a/src/retell/resources/agent.py +++ b/src/retell/resources/agent.py @@ -67,6 +67,7 @@ def create( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, + enable_transcription_formatting: 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, @@ -223,6 +224,10 @@ def create( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. + enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to + false, will return transcripts in raw words. If not set, default value of true + will apply. This currently only applies to English. + 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). @@ -352,6 +357,7 @@ def create( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, + "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -447,6 +453,7 @@ def update( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, + enable_transcription_formatting: 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, @@ -600,6 +607,10 @@ def update( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. + enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to + false, will return transcripts in raw words. If not set, default value of true + will apply. This currently only applies to English. + 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). @@ -736,6 +747,7 @@ def update( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, + "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -904,6 +916,7 @@ async def create( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, + enable_transcription_formatting: 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, @@ -1060,6 +1073,10 @@ async def create( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. + enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to + false, will return transcripts in raw words. If not set, default value of true + will apply. This currently only applies to English. + 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,6 +1206,7 @@ async def create( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, + "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -1284,6 +1302,7 @@ async def update( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, + enable_transcription_formatting: 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, @@ -1437,6 +1456,10 @@ async def update( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. + enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to + false, will return transcripts in raw words. If not set, default value of true + will apply. This currently only applies to English. + 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). @@ -1573,6 +1596,7 @@ async def update( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, + "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, diff --git a/src/retell/resources/call.py b/src/retell/resources/call.py index 13881c65..ded37327 100644 --- a/src/retell/resources/call.py +++ b/src/retell/resources/call.py @@ -236,7 +236,6 @@ def create_phone_call( *, from_number: str, to_number: str, - custom_sip_headers: Dict[str, str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, override_agent_id: str | NotGiven = NOT_GIVEN, override_agent_version: int | NotGiven = NOT_GIVEN, @@ -258,8 +257,6 @@ def create_phone_call( to_number: The number you want to call, in E.164 format. If using a number purchased from Retell, only US numbers are supported as destination. - custom_sip_headers: Add optional custom SIP headers to the call. - metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the call. Not used for processing. You can later get this field from the call object. @@ -289,7 +286,6 @@ def create_phone_call( { "from_number": from_number, "to_number": to_number, - "custom_sip_headers": custom_sip_headers, "metadata": metadata, "override_agent_id": override_agent_id, "override_agent_version": override_agent_version, @@ -631,7 +627,6 @@ async def create_phone_call( *, from_number: str, to_number: str, - custom_sip_headers: Dict[str, str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, override_agent_id: str | NotGiven = NOT_GIVEN, override_agent_version: int | NotGiven = NOT_GIVEN, @@ -653,8 +648,6 @@ async def create_phone_call( to_number: The number you want to call, in E.164 format. If using a number purchased from Retell, only US numbers are supported as destination. - custom_sip_headers: Add optional custom SIP headers to the call. - metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the call. Not used for processing. You can later get this field from the call object. @@ -684,7 +677,6 @@ async def create_phone_call( { "from_number": from_number, "to_number": to_number, - "custom_sip_headers": custom_sip_headers, "metadata": metadata, "override_agent_id": override_agent_id, "override_agent_version": override_agent_version, diff --git a/src/retell/resources/chat.py b/src/retell/resources/chat.py index 99af968c..0589378a 100644 --- a/src/retell/resources/chat.py +++ b/src/retell/resources/chat.py @@ -65,8 +65,7 @@ def create( Args: agent_id: The chat agent to use for the call. - agent_version: The version of the chat agent to use for the call. If not provided, will default - to latest version. + agent_version: The version of the chat agent to use for the call. metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You @@ -271,8 +270,7 @@ async def create( Args: agent_id: The chat agent to use for the call. - agent_version: The version of the chat agent to use for the call. If not provided, will default - to latest version. + agent_version: The version of the chat agent to use for the call. metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You diff --git a/src/retell/types/agent_create_params.py b/src/retell/types/agent_create_params.py index 7b536200..e28fa8c2 100644 --- a/src/retell/types/agent_create_params.py +++ b/src/retell/types/agent_create_params.py @@ -130,6 +130,13 @@ class AgentCreateParams(TypedDict, total=False): will not backchannel. """ + enable_transcription_formatting: bool + """If set to true, will format transcription to number, date, email, etc. + + If set to false, will return transcripts in raw words. If not set, default value + of true will apply. This currently only applies to English. + """ + end_call_after_silence_ms: int """If users stay silent for a period after agent speech, end the call. diff --git a/src/retell/types/agent_response.py b/src/retell/types/agent_response.py index c7f4080e..1b9a0db8 100644 --- a/src/retell/types/agent_response.py +++ b/src/retell/types/agent_response.py @@ -299,6 +299,13 @@ class AgentResponse(BaseModel): will not backchannel. """ + enable_transcription_formatting: Optional[bool] = None + """If set to true, will format transcription to number, date, email, etc. + + If set to false, will return transcripts in raw words. If not set, default value + of true will apply. This currently only applies to English. + """ + end_call_after_silence_ms: Optional[int] = None """If users stay silent for a period after agent speech, end the call. diff --git a/src/retell/types/agent_update_params.py b/src/retell/types/agent_update_params.py index 2898ab1a..be9cf480 100644 --- a/src/retell/types/agent_update_params.py +++ b/src/retell/types/agent_update_params.py @@ -122,6 +122,13 @@ class AgentUpdateParams(TypedDict, total=False): will not backchannel. """ + enable_transcription_formatting: bool + """If set to true, will format transcription to number, date, email, etc. + + If set to false, will return transcripts in raw words. If not set, default value + of true will apply. This currently only applies to English. + """ + end_call_after_silence_ms: int """If users stay silent for a period after agent speech, end the call. diff --git a/src/retell/types/call_create_phone_call_params.py b/src/retell/types/call_create_phone_call_params.py index 474bebce..5306274e 100644 --- a/src/retell/types/call_create_phone_call_params.py +++ b/src/retell/types/call_create_phone_call_params.py @@ -22,9 +22,6 @@ class CallCreatePhoneCallParams(TypedDict, total=False): destination. """ - custom_sip_headers: Dict[str, str] - """Add optional custom SIP headers to the call.""" - metadata: object """An arbitrary object for storage purpose only. diff --git a/src/retell/types/chat_create_params.py b/src/retell/types/chat_create_params.py index 33503f19..61a59ae9 100644 --- a/src/retell/types/chat_create_params.py +++ b/src/retell/types/chat_create_params.py @@ -13,10 +13,7 @@ class ChatCreateParams(TypedDict, total=False): """The chat agent to use for the call.""" agent_version: int - """The version of the chat agent to use for the call. - - If not provided, will default to latest version. - """ + """The version of the chat agent to use for the call.""" metadata: object """An arbitrary object for storage purpose only. diff --git a/src/retell/types/llm_create_params.py b/src/retell/types/llm_create_params.py index 4d29a063..a045b76a 100644 --- a/src/retell/types/llm_create_params.py +++ b/src/retell/types/llm_create_params.py @@ -265,9 +265,6 @@ class GeneralToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] - custom_sip_headers: Dict[str, str] - """Custom SIP headers to be added to the call.""" - description: str """ Describes what the tool does, sometimes can also include information about when @@ -641,9 +638,6 @@ class StateToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] - custom_sip_headers: Dict[str, str] - """Custom SIP headers to be added to the call.""" - description: str """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/llm_response.py b/src/retell/types/llm_response.py index 1f1c554b..a58a9a55 100644 --- a/src/retell/types/llm_response.py +++ b/src/retell/types/llm_response.py @@ -168,9 +168,6 @@ class GeneralToolTransferCallTool(BaseModel): type: Literal["transfer_call"] - custom_sip_headers: Optional[Dict[str, str]] = None - """Custom SIP headers to be added to the call.""" - description: Optional[str] = None """ Describes what the tool does, sometimes can also include information about when @@ -544,9 +541,6 @@ class StateToolTransferCallTool(BaseModel): type: Literal["transfer_call"] - custom_sip_headers: Optional[Dict[str, str]] = None - """Custom SIP headers to be added to the call.""" - description: Optional[str] = None """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/llm_update_params.py b/src/retell/types/llm_update_params.py index 5d633d76..ef7cf682 100644 --- a/src/retell/types/llm_update_params.py +++ b/src/retell/types/llm_update_params.py @@ -270,9 +270,6 @@ class GeneralToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] - custom_sip_headers: Dict[str, str] - """Custom SIP headers to be added to the call.""" - description: str """ Describes what the tool does, sometimes can also include information about when @@ -646,9 +643,6 @@ class StateToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] - custom_sip_headers: Dict[str, str] - """Custom SIP headers to be added to the call.""" - description: str """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/phone_call_response.py b/src/retell/types/phone_call_response.py index 76c70531..7c5b999c 100644 --- a/src/retell/types/phone_call_response.py +++ b/src/retell/types/phone_call_response.py @@ -457,9 +457,6 @@ class PhoneCallResponse(BaseModel): collected_dynamic_variables: Optional[Dict[str, object]] = None """Dynamic variables collected from the call. Only available after the call ends.""" - custom_sip_headers: Optional[Dict[str, str]] = None - """Custom SIP headers to be added to the call.""" - disconnection_reason: Optional[ Literal[ "user_hangup", diff --git a/src/retell/types/web_call_response.py b/src/retell/types/web_call_response.py index e7243f25..bbaee969 100644 --- a/src/retell/types/web_call_response.py +++ b/src/retell/types/web_call_response.py @@ -448,9 +448,6 @@ class WebCallResponse(BaseModel): collected_dynamic_variables: Optional[Dict[str, object]] = None """Dynamic variables collected from the call. Only available after the call ends.""" - custom_sip_headers: Optional[Dict[str, str]] = None - """Custom SIP headers to be added to the call.""" - disconnection_reason: Optional[ Literal[ "user_hangup", diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index f5772977..8439b925 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -51,6 +51,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, + enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -201,6 +202,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, + enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -425,6 +427,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, + enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -575,6 +578,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, + enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, diff --git a/tests/api_resources/test_call.py b/tests/api_resources/test_call.py index fdd6772f..ac2d7147 100644 --- a/tests/api_resources/test_call.py +++ b/tests/api_resources/test_call.py @@ -220,7 +220,6 @@ def test_method_create_phone_call_with_all_params(self, client: Retell) -> None: call = client.call.create_phone_call( from_number="+14157774444", to_number="+12137774445", - custom_sip_headers={"X-Custom-Header": "Custom Value"}, metadata={}, override_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", override_agent_version=1, @@ -543,7 +542,6 @@ async def test_method_create_phone_call_with_all_params(self, async_client: Asyn call = await async_client.call.create_phone_call( from_number="+14157774444", to_number="+12137774445", - custom_sip_headers={"X-Custom-Header": "Custom Value"}, metadata={}, override_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", override_agent_version=1, diff --git a/tests/api_resources/test_llm.py b/tests/api_resources/test_llm.py index 968fa6c6..7e1bf503 100644 --- a/tests/api_resources/test_llm.py +++ b/tests/api_resources/test_llm.py @@ -68,7 +68,6 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -225,7 +224,6 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -412,7 +410,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -569,7 +566,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", - "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], From cced89c6e18c338a66051764fdbcd7cd8decbba4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Jun 2025 14:07:44 +0000 Subject: [PATCH 14/22] =?UTF-8?q?fix(ci):=20release-doctor=20=E2=80=94=20r?= =?UTF-8?q?eport=20correct=20token=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/check-release-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index 4664ca28..b845b0f4 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${PYPI_TOKEN}" ]; then - errors+=("The RETELL_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From 9771f599c1798c95828a9582c8d460723facd5d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:38:08 +0000 Subject: [PATCH 15/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/types/llm_create_params.py | 2 ++ src/retell/types/llm_response.py | 2 ++ src/retell/types/llm_update_params.py | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a49775ca..5509de18 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-aa47014eca391b07848fe3f18c1c5081b6f5c214d64f470a65fb48a7211ec7d4.yml -openapi_spec_hash: b330cedf40c1ff1e0dc865e5227b0aa2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-6cf1763ce468526a293919cfce8e947b9d819812c98d047134c09add151ec343.yml +openapi_spec_hash: 19e7a426c41b5047692f0845144334e6 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/types/llm_create_params.py b/src/retell/types/llm_create_params.py index a045b76a..3e075d45 100644 --- a/src/retell/types/llm_create_params.py +++ b/src/retell/types/llm_create_params.py @@ -474,6 +474,7 @@ class GeneralToolCustomTool(TypedDict, total=False): GeneralToolBookAppointmentCalTool, GeneralToolPressDigitTool, GeneralToolCustomTool, + object, ] @@ -847,6 +848,7 @@ class StateToolCustomTool(TypedDict, total=False): StateToolBookAppointmentCalTool, StateToolPressDigitTool, StateToolCustomTool, + object, ] diff --git a/src/retell/types/llm_response.py b/src/retell/types/llm_response.py index a58a9a55..4256c251 100644 --- a/src/retell/types/llm_response.py +++ b/src/retell/types/llm_response.py @@ -377,6 +377,7 @@ class GeneralToolCustomTool(BaseModel): GeneralToolBookAppointmentCalTool, GeneralToolPressDigitTool, GeneralToolCustomTool, + object, ] @@ -750,6 +751,7 @@ class StateToolCustomTool(BaseModel): StateToolBookAppointmentCalTool, StateToolPressDigitTool, StateToolCustomTool, + object, ] diff --git a/src/retell/types/llm_update_params.py b/src/retell/types/llm_update_params.py index ef7cf682..59a5d68e 100644 --- a/src/retell/types/llm_update_params.py +++ b/src/retell/types/llm_update_params.py @@ -479,6 +479,7 @@ class GeneralToolCustomTool(TypedDict, total=False): GeneralToolBookAppointmentCalTool, GeneralToolPressDigitTool, GeneralToolCustomTool, + object, ] @@ -852,6 +853,7 @@ class StateToolCustomTool(TypedDict, total=False): StateToolBookAppointmentCalTool, StateToolPressDigitTool, StateToolCustomTool, + object, ] From a4f71a144677a3d9046cdfea1928a1683bce248a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:44:33 +0000 Subject: [PATCH 16/22] feat(api): api update --- .stats.yml | 4 +- src/retell/types/llm_create_params.py | 174 +++++++++++++++++++++++++- src/retell/types/llm_response.py | 174 +++++++++++++++++++++++++- src/retell/types/llm_update_params.py | 174 +++++++++++++++++++++++++- 4 files changed, 518 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5509de18..d317728d 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-6cf1763ce468526a293919cfce8e947b9d819812c98d047134c09add151ec343.yml -openapi_spec_hash: 19e7a426c41b5047692f0845144334e6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-ca8ab031b3d415ccfec12b20bdee387c5a24bdc47e41e92cbb1217512629d880.yml +openapi_spec_hash: d166e870fc97b3078196c5b9fe090bfe config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/types/llm_create_params.py b/src/retell/types/llm_create_params.py index 3e075d45..4bd735f7 100644 --- a/src/retell/types/llm_create_params.py +++ b/src/retell/types/llm_create_params.py @@ -24,6 +24,12 @@ "GeneralToolPressDigitTool", "GeneralToolCustomTool", "GeneralToolCustomToolParameters", + "GeneralToolExtractDynamicVariableTool", + "GeneralToolExtractDynamicVariableToolVariable", + "GeneralToolExtractDynamicVariableToolVariableStringAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData", "State", "StateEdge", "StateEdgeParameters", @@ -44,6 +50,12 @@ "StateToolPressDigitTool", "StateToolCustomTool", "StateToolCustomToolParameters", + "StateToolExtractDynamicVariableTool", + "StateToolExtractDynamicVariableToolVariable", + "StateToolExtractDynamicVariableToolVariableStringAnalysisData", + "StateToolExtractDynamicVariableToolVariableEnumAnalysisData", + "StateToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "StateToolExtractDynamicVariableToolVariableNumberAnalysisData", ] @@ -467,6 +479,85 @@ class GeneralToolCustomTool(TypedDict, total=False): """ +class GeneralToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["string"]] + """Type of the variable to extract.""" + + examples: List[str] + """Examples of the variable value to teach model the style and syntax.""" + + +class GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[List[str]] + """The possible values of the variable, must be non empty array.""" + + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + + +class GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + + +class GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["number"]] + """Type of the variable to extract.""" + + +GeneralToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + GeneralToolExtractDynamicVariableToolVariableStringAnalysisData, + GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData, + GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData, + GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class GeneralToolExtractDynamicVariableTool(TypedDict, total=False): + description: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["extract_dynamic_variable"]] + + variables: Required[Iterable[GeneralToolExtractDynamicVariableToolVariable]] + """The variables to be extracted.""" + + GeneralTool: TypeAlias = Union[ GeneralToolEndCallTool, GeneralToolTransferCallTool, @@ -474,7 +565,7 @@ class GeneralToolCustomTool(TypedDict, total=False): GeneralToolBookAppointmentCalTool, GeneralToolPressDigitTool, GeneralToolCustomTool, - object, + GeneralToolExtractDynamicVariableTool, ] @@ -841,6 +932,85 @@ class StateToolCustomTool(TypedDict, total=False): """ +class StateToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["string"]] + """Type of the variable to extract.""" + + examples: List[str] + """Examples of the variable value to teach model the style and syntax.""" + + +class StateToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[List[str]] + """The possible values of the variable, must be non empty array.""" + + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + + +class StateToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + + +class StateToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["number"]] + """Type of the variable to extract.""" + + +StateToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + StateToolExtractDynamicVariableToolVariableStringAnalysisData, + StateToolExtractDynamicVariableToolVariableEnumAnalysisData, + StateToolExtractDynamicVariableToolVariableBooleanAnalysisData, + StateToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class StateToolExtractDynamicVariableTool(TypedDict, total=False): + description: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["extract_dynamic_variable"]] + + variables: Required[Iterable[StateToolExtractDynamicVariableToolVariable]] + """The variables to be extracted.""" + + StateTool: TypeAlias = Union[ StateToolEndCallTool, StateToolTransferCallTool, @@ -848,7 +1018,7 @@ class StateToolCustomTool(TypedDict, total=False): StateToolBookAppointmentCalTool, StateToolPressDigitTool, StateToolCustomTool, - object, + StateToolExtractDynamicVariableTool, ] diff --git a/src/retell/types/llm_response.py b/src/retell/types/llm_response.py index 4256c251..a56a7aba 100644 --- a/src/retell/types/llm_response.py +++ b/src/retell/types/llm_response.py @@ -26,6 +26,12 @@ "GeneralToolPressDigitTool", "GeneralToolCustomTool", "GeneralToolCustomToolParameters", + "GeneralToolExtractDynamicVariableTool", + "GeneralToolExtractDynamicVariableToolVariable", + "GeneralToolExtractDynamicVariableToolVariableStringAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData", "State", "StateEdge", "StateEdgeParameters", @@ -46,6 +52,12 @@ "StateToolPressDigitTool", "StateToolCustomTool", "StateToolCustomToolParameters", + "StateToolExtractDynamicVariableTool", + "StateToolExtractDynamicVariableToolVariable", + "StateToolExtractDynamicVariableToolVariableStringAnalysisData", + "StateToolExtractDynamicVariableToolVariableEnumAnalysisData", + "StateToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "StateToolExtractDynamicVariableToolVariableNumberAnalysisData", ] @@ -370,6 +382,85 @@ class GeneralToolCustomTool(BaseModel): """ +class GeneralToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["string"] + """Type of the variable to extract.""" + + examples: Optional[List[str]] = None + """Examples of the variable value to teach model the style and syntax.""" + + +class GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): + choices: List[str] + """The possible values of the variable, must be non empty array.""" + + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["enum"] + """Type of the variable to extract.""" + + +class GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["boolean"] + """Type of the variable to extract.""" + + +class GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["number"] + """Type of the variable to extract.""" + + +GeneralToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + GeneralToolExtractDynamicVariableToolVariableStringAnalysisData, + GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData, + GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData, + GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class GeneralToolExtractDynamicVariableTool(BaseModel): + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: str + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Literal["extract_dynamic_variable"] + + variables: List[GeneralToolExtractDynamicVariableToolVariable] + """The variables to be extracted.""" + + GeneralTool: TypeAlias = Union[ GeneralToolEndCallTool, GeneralToolTransferCallTool, @@ -377,7 +468,7 @@ class GeneralToolCustomTool(BaseModel): GeneralToolBookAppointmentCalTool, GeneralToolPressDigitTool, GeneralToolCustomTool, - object, + GeneralToolExtractDynamicVariableTool, ] @@ -744,6 +835,85 @@ class StateToolCustomTool(BaseModel): """ +class StateToolExtractDynamicVariableToolVariableStringAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["string"] + """Type of the variable to extract.""" + + examples: Optional[List[str]] = None + """Examples of the variable value to teach model the style and syntax.""" + + +class StateToolExtractDynamicVariableToolVariableEnumAnalysisData(BaseModel): + choices: List[str] + """The possible values of the variable, must be non empty array.""" + + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["enum"] + """Type of the variable to extract.""" + + +class StateToolExtractDynamicVariableToolVariableBooleanAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["boolean"] + """Type of the variable to extract.""" + + +class StateToolExtractDynamicVariableToolVariableNumberAnalysisData(BaseModel): + description: str + """Description of the variable.""" + + name: str + """Name of the variable.""" + + type: Literal["number"] + """Type of the variable to extract.""" + + +StateToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + StateToolExtractDynamicVariableToolVariableStringAnalysisData, + StateToolExtractDynamicVariableToolVariableEnumAnalysisData, + StateToolExtractDynamicVariableToolVariableBooleanAnalysisData, + StateToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class StateToolExtractDynamicVariableTool(BaseModel): + description: str + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: str + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Literal["extract_dynamic_variable"] + + variables: List[StateToolExtractDynamicVariableToolVariable] + """The variables to be extracted.""" + + StateTool: TypeAlias = Union[ StateToolEndCallTool, StateToolTransferCallTool, @@ -751,7 +921,7 @@ class StateToolCustomTool(BaseModel): StateToolBookAppointmentCalTool, StateToolPressDigitTool, StateToolCustomTool, - object, + StateToolExtractDynamicVariableTool, ] diff --git a/src/retell/types/llm_update_params.py b/src/retell/types/llm_update_params.py index 59a5d68e..02b15301 100644 --- a/src/retell/types/llm_update_params.py +++ b/src/retell/types/llm_update_params.py @@ -26,6 +26,12 @@ "GeneralToolPressDigitTool", "GeneralToolCustomTool", "GeneralToolCustomToolParameters", + "GeneralToolExtractDynamicVariableTool", + "GeneralToolExtractDynamicVariableToolVariable", + "GeneralToolExtractDynamicVariableToolVariableStringAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData", "State", "StateEdge", "StateEdgeParameters", @@ -46,6 +52,12 @@ "StateToolPressDigitTool", "StateToolCustomTool", "StateToolCustomToolParameters", + "StateToolExtractDynamicVariableTool", + "StateToolExtractDynamicVariableToolVariable", + "StateToolExtractDynamicVariableToolVariableStringAnalysisData", + "StateToolExtractDynamicVariableToolVariableEnumAnalysisData", + "StateToolExtractDynamicVariableToolVariableBooleanAnalysisData", + "StateToolExtractDynamicVariableToolVariableNumberAnalysisData", ] @@ -472,6 +484,85 @@ class GeneralToolCustomTool(TypedDict, total=False): """ +class GeneralToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["string"]] + """Type of the variable to extract.""" + + examples: List[str] + """Examples of the variable value to teach model the style and syntax.""" + + +class GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[List[str]] + """The possible values of the variable, must be non empty array.""" + + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + + +class GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + + +class GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["number"]] + """Type of the variable to extract.""" + + +GeneralToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + GeneralToolExtractDynamicVariableToolVariableStringAnalysisData, + GeneralToolExtractDynamicVariableToolVariableEnumAnalysisData, + GeneralToolExtractDynamicVariableToolVariableBooleanAnalysisData, + GeneralToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class GeneralToolExtractDynamicVariableTool(TypedDict, total=False): + description: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["extract_dynamic_variable"]] + + variables: Required[Iterable[GeneralToolExtractDynamicVariableToolVariable]] + """The variables to be extracted.""" + + GeneralTool: TypeAlias = Union[ GeneralToolEndCallTool, GeneralToolTransferCallTool, @@ -479,7 +570,7 @@ class GeneralToolCustomTool(TypedDict, total=False): GeneralToolBookAppointmentCalTool, GeneralToolPressDigitTool, GeneralToolCustomTool, - object, + GeneralToolExtractDynamicVariableTool, ] @@ -846,6 +937,85 @@ class StateToolCustomTool(TypedDict, total=False): """ +class StateToolExtractDynamicVariableToolVariableStringAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["string"]] + """Type of the variable to extract.""" + + examples: List[str] + """Examples of the variable value to teach model the style and syntax.""" + + +class StateToolExtractDynamicVariableToolVariableEnumAnalysisData(TypedDict, total=False): + choices: Required[List[str]] + """The possible values of the variable, must be non empty array.""" + + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["enum"]] + """Type of the variable to extract.""" + + +class StateToolExtractDynamicVariableToolVariableBooleanAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["boolean"]] + """Type of the variable to extract.""" + + +class StateToolExtractDynamicVariableToolVariableNumberAnalysisData(TypedDict, total=False): + description: Required[str] + """Description of the variable.""" + + name: Required[str] + """Name of the variable.""" + + type: Required[Literal["number"]] + """Type of the variable to extract.""" + + +StateToolExtractDynamicVariableToolVariable: TypeAlias = Union[ + StateToolExtractDynamicVariableToolVariableStringAnalysisData, + StateToolExtractDynamicVariableToolVariableEnumAnalysisData, + StateToolExtractDynamicVariableToolVariableBooleanAnalysisData, + StateToolExtractDynamicVariableToolVariableNumberAnalysisData, +] + + +class StateToolExtractDynamicVariableTool(TypedDict, total=False): + description: Required[str] + """ + Describes what the tool does, sometimes can also include information about when + to call the tool. + """ + + name: Required[str] + """Name of the tool. + + Must be unique within all tools available to LLM at any given time (general + tools + state tools + state edges). Must be consisted of a-z, A-Z, 0-9, or + contain underscores and dashes, with a maximum length of 64 (no space allowed). + """ + + type: Required[Literal["extract_dynamic_variable"]] + + variables: Required[Iterable[StateToolExtractDynamicVariableToolVariable]] + """The variables to be extracted.""" + + StateTool: TypeAlias = Union[ StateToolEndCallTool, StateToolTransferCallTool, @@ -853,7 +1023,7 @@ class StateToolCustomTool(TypedDict, total=False): StateToolBookAppointmentCalTool, StateToolPressDigitTool, StateToolCustomTool, - object, + StateToolExtractDynamicVariableTool, ] From 619e43a84070a10d57973a7d79d33131e639f2fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:41:13 +0000 Subject: [PATCH 17/22] chore(ci): only run for pushes and fork pull requests --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cf368ba..3ecad580 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/toddlzt-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -42,6 +43,7 @@ jobs: contents: read id-token: write runs-on: depot-ubuntu-24.04 + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -62,6 +64,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/toddlzt-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From 74d373a7bf52e19f231ce745a041d92877ddcda9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Jun 2025 07:45:30 +0000 Subject: [PATCH 18/22] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d317728d..15a484e7 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-ca8ab031b3d415ccfec12b20bdee387c5a24bdc47e41e92cbb1217512629d880.yml -openapi_spec_hash: d166e870fc97b3078196c5b9fe090bfe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-a7dc18ff9e966f15b8bcc06db6384267760d38a24b56cafb31eac3fe4442e018.yml +openapi_spec_hash: fb9ec8a15c327066f272e6a9c1f500ab config_hash: f4bc63f2350a2a4988750b41a0737f9d From 3a5605f8876535b1b8ee4b61d018afeaa6b21fdb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 06:20:39 +0000 Subject: [PATCH 19/22] fix(ci): correct conditional --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ecad580..d6dc3e22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,14 +36,13 @@ jobs: run: ./scripts/lint upload: - if: github.repository == 'stainless-sdks/toddlzt-python' + if: github.repository == 'stainless-sdks/toddlzt-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 name: upload permissions: contents: read id-token: write runs-on: depot-ubuntu-24.04 - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From 8231ac42d5758c5e9a211884222caddb43544c04 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 23:14:01 +0000 Subject: [PATCH 20/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/resources/agent.py | 8 -------- src/retell/types/agent_create_params.py | 2 -- src/retell/types/agent_response.py | 2 -- src/retell/types/agent_update_params.py | 2 -- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 15a484e7..5e40ef25 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-a7dc18ff9e966f15b8bcc06db6384267760d38a24b56cafb31eac3fe4442e018.yml -openapi_spec_hash: fb9ec8a15c327066f272e6a9c1f500ab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-da3e6185b757103531dc379fa2cc0c12444a2088699f2b665269370b630acb3d.yml +openapi_spec_hash: 0528b77b0f85557d28dd7242f006132a config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/resources/agent.py b/src/retell/resources/agent.py index dcc91dee..476f95ec 100644 --- a/src/retell/resources/agent.py +++ b/src/retell/resources/agent.py @@ -133,8 +133,6 @@ def create( "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] @@ -521,8 +519,6 @@ def update( "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] @@ -982,8 +978,6 @@ async def create( "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] @@ -1370,8 +1364,6 @@ async def update( "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] diff --git a/src/retell/types/agent_create_params.py b/src/retell/types/agent_create_params.py index e28fa8c2..bdd10ae0 100644 --- a/src/retell/types/agent_create_params.py +++ b/src/retell/types/agent_create_params.py @@ -313,8 +313,6 @@ class AgentCreateParams(TypedDict, total=False): "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] diff --git a/src/retell/types/agent_response.py b/src/retell/types/agent_response.py index 1b9a0db8..6188ef2c 100644 --- a/src/retell/types/agent_response.py +++ b/src/retell/types/agent_response.py @@ -487,8 +487,6 @@ class AgentResponse(BaseModel): "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] diff --git a/src/retell/types/agent_update_params.py b/src/retell/types/agent_update_params.py index be9cf480..8e241727 100644 --- a/src/retell/types/agent_update_params.py +++ b/src/retell/types/agent_update_params.py @@ -318,8 +318,6 @@ class AgentUpdateParams(TypedDict, total=False): "eleven_turbo_v2_5", "eleven_flash_v2_5", "eleven_multilingual_v2", - "Play3.0-mini", - "PlayDialog", "tts-1", "gpt-4o-mini-tts", ] From 95c3188963aee89f451b3afd5b976ed2a222bd96 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 23:30:54 +0000 Subject: [PATCH 21/22] feat(api): api update --- .stats.yml | 4 ++-- src/retell/resources/agent.py | 24 ------------------- src/retell/resources/call.py | 8 +++++++ src/retell/resources/chat.py | 6 +++-- src/retell/types/agent_create_params.py | 7 ------ src/retell/types/agent_response.py | 7 ------ src/retell/types/agent_update_params.py | 7 ------ .../types/call_create_phone_call_params.py | 3 +++ src/retell/types/chat_create_params.py | 5 +++- src/retell/types/llm_create_params.py | 6 +++++ src/retell/types/llm_response.py | 6 +++++ src/retell/types/llm_update_params.py | 6 +++++ src/retell/types/phone_call_response.py | 3 +++ src/retell/types/web_call_response.py | 3 +++ tests/api_resources/test_agent.py | 4 ---- tests/api_resources/test_call.py | 2 ++ tests/api_resources/test_llm.py | 4 ++++ 17 files changed, 51 insertions(+), 54 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5e40ef25..51983f36 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-da3e6185b757103531dc379fa2cc0c12444a2088699f2b665269370b630acb3d.yml -openapi_spec_hash: 0528b77b0f85557d28dd7242f006132a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-b9085cd6eb0e7f2798412d918e4327040bf1f7076a85001ea56ee7d55f7a306c.yml +openapi_spec_hash: a7b3e777b15c7901c94efa5a3132b9c0 config_hash: f4bc63f2350a2a4988750b41a0737f9d diff --git a/src/retell/resources/agent.py b/src/retell/resources/agent.py index 476f95ec..cb01223b 100644 --- a/src/retell/resources/agent.py +++ b/src/retell/resources/agent.py @@ -67,7 +67,6 @@ def create( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, - enable_transcription_formatting: 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, @@ -222,10 +221,6 @@ def create( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. - enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to - false, will return transcripts in raw words. If not set, default value of true - will apply. This currently only applies to English. - 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). @@ -355,7 +350,6 @@ def create( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, - "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -451,7 +445,6 @@ def update( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, - enable_transcription_formatting: 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, @@ -603,10 +596,6 @@ def update( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. - enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to - false, will return transcripts in raw words. If not set, default value of true - will apply. This currently only applies to English. - 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). @@ -743,7 +732,6 @@ def update( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, - "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -912,7 +900,6 @@ async def create( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, - enable_transcription_formatting: 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, @@ -1067,10 +1054,6 @@ async def create( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. - enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to - false, will return transcripts in raw words. If not set, default value of true - will apply. This currently only applies to English. - 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). @@ -1200,7 +1183,6 @@ async def create( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, - "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, @@ -1296,7 +1278,6 @@ async def update( denoising_mode: Literal["noise-cancellation", "noise-and-background-speech-cancellation"] | NotGiven = NOT_GIVEN, enable_backchannel: bool | NotGiven = NOT_GIVEN, - enable_transcription_formatting: 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, @@ -1448,10 +1429,6 @@ async def update( when enabled tends to show up more in longer user utterances. If not set, agent will not backchannel. - enable_transcription_formatting: If set to true, will format transcription to number, date, email, etc. If set to - false, will return transcripts in raw words. If not set, default value of true - will apply. This currently only applies to English. - 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,7 +1565,6 @@ async def update( "boosted_keywords": boosted_keywords, "denoising_mode": denoising_mode, "enable_backchannel": enable_backchannel, - "enable_transcription_formatting": enable_transcription_formatting, "end_call_after_silence_ms": end_call_after_silence_ms, "fallback_voice_ids": fallback_voice_ids, "interruption_sensitivity": interruption_sensitivity, diff --git a/src/retell/resources/call.py b/src/retell/resources/call.py index ded37327..13881c65 100644 --- a/src/retell/resources/call.py +++ b/src/retell/resources/call.py @@ -236,6 +236,7 @@ def create_phone_call( *, from_number: str, to_number: str, + custom_sip_headers: Dict[str, str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, override_agent_id: str | NotGiven = NOT_GIVEN, override_agent_version: int | NotGiven = NOT_GIVEN, @@ -257,6 +258,8 @@ def create_phone_call( to_number: The number you want to call, in E.164 format. If using a number purchased from Retell, only US numbers are supported as destination. + custom_sip_headers: Add optional custom SIP headers to the call. + metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the call. Not used for processing. You can later get this field from the call object. @@ -286,6 +289,7 @@ def create_phone_call( { "from_number": from_number, "to_number": to_number, + "custom_sip_headers": custom_sip_headers, "metadata": metadata, "override_agent_id": override_agent_id, "override_agent_version": override_agent_version, @@ -627,6 +631,7 @@ async def create_phone_call( *, from_number: str, to_number: str, + custom_sip_headers: Dict[str, str] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, override_agent_id: str | NotGiven = NOT_GIVEN, override_agent_version: int | NotGiven = NOT_GIVEN, @@ -648,6 +653,8 @@ async def create_phone_call( to_number: The number you want to call, in E.164 format. If using a number purchased from Retell, only US numbers are supported as destination. + custom_sip_headers: Add optional custom SIP headers to the call. + metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the call. Not used for processing. You can later get this field from the call object. @@ -677,6 +684,7 @@ async def create_phone_call( { "from_number": from_number, "to_number": to_number, + "custom_sip_headers": custom_sip_headers, "metadata": metadata, "override_agent_id": override_agent_id, "override_agent_version": override_agent_version, diff --git a/src/retell/resources/chat.py b/src/retell/resources/chat.py index 0589378a..22bf5ccd 100644 --- a/src/retell/resources/chat.py +++ b/src/retell/resources/chat.py @@ -65,7 +65,8 @@ def create( Args: agent_id: The chat agent to use for the call. - agent_version: The version of the chat agent to use for the call. + agent_version: The version of the chat agent to use for the chat. If not provided, will default + to latest version. metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You @@ -270,7 +271,8 @@ async def create( Args: agent_id: The chat agent to use for the call. - agent_version: The version of the chat agent to use for the call. + agent_version: The version of the chat agent to use for the chat. If not provided, will default + to latest version. metadata: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You diff --git a/src/retell/types/agent_create_params.py b/src/retell/types/agent_create_params.py index bdd10ae0..82752478 100644 --- a/src/retell/types/agent_create_params.py +++ b/src/retell/types/agent_create_params.py @@ -130,13 +130,6 @@ class AgentCreateParams(TypedDict, total=False): will not backchannel. """ - enable_transcription_formatting: bool - """If set to true, will format transcription to number, date, email, etc. - - If set to false, will return transcripts in raw words. If not set, default value - of true will apply. This currently only applies to English. - """ - end_call_after_silence_ms: int """If users stay silent for a period after agent speech, end the call. diff --git a/src/retell/types/agent_response.py b/src/retell/types/agent_response.py index 6188ef2c..48e859f1 100644 --- a/src/retell/types/agent_response.py +++ b/src/retell/types/agent_response.py @@ -299,13 +299,6 @@ class AgentResponse(BaseModel): will not backchannel. """ - enable_transcription_formatting: Optional[bool] = None - """If set to true, will format transcription to number, date, email, etc. - - If set to false, will return transcripts in raw words. If not set, default value - of true will apply. This currently only applies to English. - """ - end_call_after_silence_ms: Optional[int] = None """If users stay silent for a period after agent speech, end the call. diff --git a/src/retell/types/agent_update_params.py b/src/retell/types/agent_update_params.py index 8e241727..cad9dfe5 100644 --- a/src/retell/types/agent_update_params.py +++ b/src/retell/types/agent_update_params.py @@ -122,13 +122,6 @@ class AgentUpdateParams(TypedDict, total=False): will not backchannel. """ - enable_transcription_formatting: bool - """If set to true, will format transcription to number, date, email, etc. - - If set to false, will return transcripts in raw words. If not set, default value - of true will apply. This currently only applies to English. - """ - end_call_after_silence_ms: int """If users stay silent for a period after agent speech, end the call. diff --git a/src/retell/types/call_create_phone_call_params.py b/src/retell/types/call_create_phone_call_params.py index 5306274e..474bebce 100644 --- a/src/retell/types/call_create_phone_call_params.py +++ b/src/retell/types/call_create_phone_call_params.py @@ -22,6 +22,9 @@ class CallCreatePhoneCallParams(TypedDict, total=False): destination. """ + custom_sip_headers: Dict[str, str] + """Add optional custom SIP headers to the call.""" + metadata: object """An arbitrary object for storage purpose only. diff --git a/src/retell/types/chat_create_params.py b/src/retell/types/chat_create_params.py index 61a59ae9..e1c60e44 100644 --- a/src/retell/types/chat_create_params.py +++ b/src/retell/types/chat_create_params.py @@ -13,7 +13,10 @@ class ChatCreateParams(TypedDict, total=False): """The chat agent to use for the call.""" agent_version: int - """The version of the chat agent to use for the call.""" + """The version of the chat agent to use for the chat. + + If not provided, will default to latest version. + """ metadata: object """An arbitrary object for storage purpose only. diff --git a/src/retell/types/llm_create_params.py b/src/retell/types/llm_create_params.py index 4bd735f7..be8a6990 100644 --- a/src/retell/types/llm_create_params.py +++ b/src/retell/types/llm_create_params.py @@ -277,6 +277,9 @@ class GeneralToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when @@ -730,6 +733,9 @@ class StateToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/llm_response.py b/src/retell/types/llm_response.py index a56a7aba..877b53c7 100644 --- a/src/retell/types/llm_response.py +++ b/src/retell/types/llm_response.py @@ -180,6 +180,9 @@ class GeneralToolTransferCallTool(BaseModel): type: Literal["transfer_call"] + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + description: Optional[str] = None """ Describes what the tool does, sometimes can also include information about when @@ -633,6 +636,9 @@ class StateToolTransferCallTool(BaseModel): type: Literal["transfer_call"] + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + description: Optional[str] = None """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/llm_update_params.py b/src/retell/types/llm_update_params.py index 02b15301..090c1b90 100644 --- a/src/retell/types/llm_update_params.py +++ b/src/retell/types/llm_update_params.py @@ -282,6 +282,9 @@ class GeneralToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when @@ -735,6 +738,9 @@ class StateToolTransferCallTool(TypedDict, total=False): type: Required[Literal["transfer_call"]] + custom_sip_headers: Dict[str, str] + """Custom SIP headers to be added to the call.""" + description: str """ Describes what the tool does, sometimes can also include information about when diff --git a/src/retell/types/phone_call_response.py b/src/retell/types/phone_call_response.py index 7c5b999c..76c70531 100644 --- a/src/retell/types/phone_call_response.py +++ b/src/retell/types/phone_call_response.py @@ -457,6 +457,9 @@ class PhoneCallResponse(BaseModel): collected_dynamic_variables: Optional[Dict[str, object]] = None """Dynamic variables collected from the call. Only available after the call ends.""" + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + disconnection_reason: Optional[ Literal[ "user_hangup", diff --git a/src/retell/types/web_call_response.py b/src/retell/types/web_call_response.py index bbaee969..e7243f25 100644 --- a/src/retell/types/web_call_response.py +++ b/src/retell/types/web_call_response.py @@ -448,6 +448,9 @@ class WebCallResponse(BaseModel): collected_dynamic_variables: Optional[Dict[str, object]] = None """Dynamic variables collected from the call. Only available after the call ends.""" + custom_sip_headers: Optional[Dict[str, str]] = None + """Custom SIP headers to be added to the call.""" + disconnection_reason: Optional[ Literal[ "user_hangup", diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index 8439b925..f5772977 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -51,7 +51,6 @@ def test_method_create_with_all_params(self, client: Retell) -> None: boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, - enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -202,7 +201,6 @@ def test_method_update_with_all_params(self, client: Retell) -> None: boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, - enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -427,7 +425,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, - enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, @@ -578,7 +575,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> boosted_keywords=["retell", "kroger"], denoising_mode="noise-cancellation", enable_backchannel=True, - enable_transcription_formatting=True, end_call_after_silence_ms=600000, fallback_voice_ids=["openai-Alloy", "deepgram-Angus"], interruption_sensitivity=1, diff --git a/tests/api_resources/test_call.py b/tests/api_resources/test_call.py index ac2d7147..fdd6772f 100644 --- a/tests/api_resources/test_call.py +++ b/tests/api_resources/test_call.py @@ -220,6 +220,7 @@ def test_method_create_phone_call_with_all_params(self, client: Retell) -> None: call = client.call.create_phone_call( from_number="+14157774444", to_number="+12137774445", + custom_sip_headers={"X-Custom-Header": "Custom Value"}, metadata={}, override_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", override_agent_version=1, @@ -542,6 +543,7 @@ async def test_method_create_phone_call_with_all_params(self, async_client: Asyn call = await async_client.call.create_phone_call( from_number="+14157774444", to_number="+12137774445", + custom_sip_headers={"X-Custom-Header": "Custom Value"}, metadata={}, override_agent_id="oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD", override_agent_version=1, diff --git a/tests/api_resources/test_llm.py b/tests/api_resources/test_llm.py index 7e1bf503..968fa6c6 100644 --- a/tests/api_resources/test_llm.py +++ b/tests/api_resources/test_llm.py @@ -68,6 +68,7 @@ def test_method_create_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -224,6 +225,7 @@ def test_method_update_with_all_params(self, client: Retell) -> None: "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -410,6 +412,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], @@ -566,6 +569,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRetell) -> "show_transferee_as_caller": False, }, "type": "transfer_call", + "custom_sip_headers": {"X-Custom-Header": "Custom Value"}, "description": "Transfer to the support team.", } ], From 9008270e63b017f708430fde2b7f0d8634ccc2f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 23:31:12 +0000 Subject: [PATCH 22/22] release: 4.37.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- src/retell/_version.py | 2 +- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ea3d667e..0a7c0458 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.36.0" + ".": "4.37.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b2753ed7..b93d2f9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # Changelog +## 4.37.0 (2025-06-29) + +Full Changelog: [v4.36.0...v4.37.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.36.0...v4.37.0) + +### Features + +* **api:** api update ([95c3188](https://github.com/RetellAI/retell-python-sdk/commit/95c3188963aee89f451b3afd5b976ed2a222bd96)) +* **api:** api update ([8231ac4](https://github.com/RetellAI/retell-python-sdk/commit/8231ac42d5758c5e9a211884222caddb43544c04)) +* **api:** api update ([a4f71a1](https://github.com/RetellAI/retell-python-sdk/commit/a4f71a144677a3d9046cdfea1928a1683bce248a)) +* **api:** api update ([9771f59](https://github.com/RetellAI/retell-python-sdk/commit/9771f599c1798c95828a9582c8d460723facd5d3)) +* **api:** api update ([0703f82](https://github.com/RetellAI/retell-python-sdk/commit/0703f822fa8c51efe5cb0ca70174d8dacadc985a)) +* **api:** api update ([2a5ba8b](https://github.com/RetellAI/retell-python-sdk/commit/2a5ba8bd792e3c10ec7ac0ca5025f300a06fe311)) +* **api:** api update ([3600f4c](https://github.com/RetellAI/retell-python-sdk/commit/3600f4cf8833658591ef72e58e33df57dc223eb4)) +* **api:** api update ([e33361b](https://github.com/RetellAI/retell-python-sdk/commit/e33361bc15fc80a3fcbb9be089742f7dfda7568b)) +* **api:** api update ([15b8af3](https://github.com/RetellAI/retell-python-sdk/commit/15b8af3658b36e040a21fc5be3c28d2e3a45bf79)) +* **client:** add support for aiohttp ([c3c2840](https://github.com/RetellAI/retell-python-sdk/commit/c3c2840e285d73c451f0a4e18ffcdf6d7bdff06a)) + + +### Bug Fixes + +* **ci:** correct conditional ([3a5605f](https://github.com/RetellAI/retell-python-sdk/commit/3a5605f8876535b1b8ee4b61d018afeaa6b21fdb)) +* **ci:** release-doctor — report correct token name ([cced89c](https://github.com/RetellAI/retell-python-sdk/commit/cced89c6e18c338a66051764fdbcd7cd8decbba4)) +* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([82eb666](https://github.com/RetellAI/retell-python-sdk/commit/82eb66606315b29827250d1db55cbc8d1201a770)) + + +### Chores + +* **ci:** enable for pull requests ([3255f4a](https://github.com/RetellAI/retell-python-sdk/commit/3255f4a2a7e57ae4dfc3e704c1895ca76d6eaeb4)) +* **ci:** only run for pushes and fork pull requests ([619e43a](https://github.com/RetellAI/retell-python-sdk/commit/619e43a84070a10d57973a7d79d33131e639f2fa)) +* **internal:** update conftest.py ([56ff61e](https://github.com/RetellAI/retell-python-sdk/commit/56ff61e8c2a353faf6b668d40b7ea96d57576789)) +* **readme:** update badges ([faaed6a](https://github.com/RetellAI/retell-python-sdk/commit/faaed6a89f513e4de848ca569140f15989ec84f3)) +* **tests:** add tests for httpx client instantiation & proxies ([f055bdf](https://github.com/RetellAI/retell-python-sdk/commit/f055bdf00ae2ab8d39684fd7674ac04845858170)) +* **tests:** skip some failing tests on the latest python versions ([8273205](https://github.com/RetellAI/retell-python-sdk/commit/827320564ec4a33ce33e5b30ca155dd83fb3f324)) + + +### Documentation + +* **client:** fix httpx.Timeout documentation reference ([bbbf5ce](https://github.com/RetellAI/retell-python-sdk/commit/bbbf5ceee0d1f5ea5578fe22d5a5046afd17e925)) + ## 4.36.0 (2025-06-16) Full Changelog: [v4.35.0...v4.36.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.35.0...v4.36.0) diff --git a/pyproject.toml b/pyproject.toml index 2b5faae9..8459aef7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "retell-sdk" -version = "4.36.0" +version = "4.37.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 473a22f9..1fd79d1b 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.36.0" # x-release-please-version +__version__ = "4.37.0" # x-release-please-version