Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.32.0"
".": "4.33.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 39
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-01ccd56ecde0b5e2e742326f26f3cf2c0bbafef856e1b032110be4880e162106.yml
openapi_spec_hash: 8b1688d1e66812ccafbe5fcf26faa67a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/retell%2Ftoddlzt-6f9abd242d6ae2ff1402a11e59ee5c26fcac97bb4a3780fb9e12096d542c6b61.yml
openapi_spec_hash: f5995d0f2a7ce0b2a88777b75dd6823f
config_hash: f4bc63f2350a2a4988750b41a0737f9d
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 4.33.0 (2025-06-04)

Full Changelog: [v4.32.0...v4.33.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.32.0...v4.33.0)

### Features

* **api:** api update ([dd7af99](https://github.com/RetellAI/retell-python-sdk/commit/dd7af99acba77ffed717d0e5011e57e92ce9debd))
* **api:** api update ([fb2e772](https://github.com/RetellAI/retell-python-sdk/commit/fb2e7725c80906892687f2b78c4fdcfa659fe984))
* **api:** api update ([323a83f](https://github.com/RetellAI/retell-python-sdk/commit/323a83f10f58d907ba1efc8fabdb4fb3a9ccbdc2))
* **api:** api update ([c642329](https://github.com/RetellAI/retell-python-sdk/commit/c6423291f5d23bfa14e652216489828c484ee94f))
* **api:** api update ([b4a0386](https://github.com/RetellAI/retell-python-sdk/commit/b4a03868e6fddb84c6e8188d9726f89b451cb0ce))
* **api:** api update ([792c706](https://github.com/RetellAI/retell-python-sdk/commit/792c706eafe63afbe41406a658d1f905a233d0b4))
* **client:** add follow_redirects request option ([2588c21](https://github.com/RetellAI/retell-python-sdk/commit/2588c217e52353aa446fa8ac4afb02f41a561c01))


### Chores

* **docs:** remove reference to rye shell ([8b4f0b8](https://github.com/RetellAI/retell-python-sdk/commit/8b4f0b804bbcede54c53e8ae63600fd6058f47e4))
* **docs:** remove unnecessary param examples ([b07cd50](https://github.com/RetellAI/retell-python-sdk/commit/b07cd50231c2da29ec2ec1a6fadee50b19ad0186))

## 4.32.0 (2025-05-26)

Full Changelog: [v4.31.0...v4.32.0](https://github.com/RetellAI/retell-python-sdk/compare/v4.31.0...v4.32.0)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ agent_response = client.agent.create(
"type": "retell-llm",
},
voice_id="11labs-Adrian",
user_dtmf_options={
"digit_limit": 1,
"termination_key": "#",
"timeout_ms": 1000,
},
user_dtmf_options={},
)
print(agent_response.user_dtmf_options)
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "retell-sdk"
version = "4.32.0"
version = "4.33.0"
description = "The official Python library for the retell API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
6 changes: 6 additions & 0 deletions src/retell/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,9 @@ def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

response = None
Expand Down Expand Up @@ -1455,6 +1458,9 @@ async def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth

if options.follow_redirects is not None:
kwargs["follow_redirects"] = options.follow_redirects

log.debug("Sending HTTP Request: %s %s", request.method, request.url)

response = None
Expand Down
2 changes: 2 additions & 0 deletions src/retell/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
idempotency_key: str
json_data: Body
extra_json: AnyMapping
follow_redirects: bool


@final
Expand All @@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
files: Union[HttpxRequestFiles, None] = None
idempotency_key: Union[str, None] = None
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
follow_redirects: Union[bool, None] = None

# It should be noted that we cannot use `json` here as that would override
# a BaseModel method in an incompatible fashion.
Expand Down
2 changes: 2 additions & 0 deletions src/retell/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
params: Query
extra_json: AnyMapping
idempotency_key: str
follow_redirects: bool


# Sentinel class used until PEP 0661 is accepted
Expand Down Expand Up @@ -215,3 +216,4 @@ class _GenericAlias(Protocol):

class HttpxSendArgs(TypedDict, total=False):
auth: httpx.Auth
follow_redirects: bool
2 changes: 1 addition & 1 deletion src/retell/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "retell"
__version__ = "4.32.0" # x-release-please-version
__version__ = "4.33.0" # x-release-please-version
4 changes: 2 additions & 2 deletions src/retell/resources/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallResponse:
"""
Update metadata and sensitive data storage settings for an existing call
Update metadata and sensitive data storage settings for an existing call.

Args:
metadata: An arbitrary object for storage purpose only. You can put anything here like
Expand Down Expand Up @@ -494,7 +494,7 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CallResponse:
"""
Update metadata and sensitive data storage settings for an existing call
Update metadata and sensitive data storage settings for an existing call.

Args:
metadata: An arbitrary object for storage purpose only. You can put anything here like
Expand Down
6 changes: 5 additions & 1 deletion src/retell/types/chat_create_chat_completion_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,8 @@ class MessageStateTransitionMessage(BaseModel):

class ChatCreateChatCompletionResponse(BaseModel):
messages: List[Message]
"""Transcript of the chat completion weaved with tool call invocation and results."""
"""
New messages generated by the agent during this completion, including any tool
call invocations and their results. Does not include the original input
messages.
"""
142 changes: 96 additions & 46 deletions src/retell/types/llm_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
"GeneralToolTransferCallToolTransferDestination",
"GeneralToolTransferCallToolTransferDestinationTransferDestinationPredefined",
"GeneralToolTransferCallToolTransferDestinationTransferDestinationInferred",
"GeneralToolTransferCallToolWarmTransferOption",
"GeneralToolTransferCallToolWarmTransferOptionWarmTransferPrompt",
"GeneralToolTransferCallToolWarmTransferOptionWarmTransferStaticMessage",
"GeneralToolTransferCallToolTransferOption",
"GeneralToolTransferCallToolTransferOptionTransferOptionColdTransfer",
"GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransfer",
"GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption",
"GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt",
"GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage",
"GeneralToolCheckAvailabilityCalTool",
"GeneralToolBookAppointmentCalTool",
"GeneralToolPressDigitTool",
Expand All @@ -30,9 +33,12 @@
"StateToolTransferCallToolTransferDestination",
"StateToolTransferCallToolTransferDestinationTransferDestinationPredefined",
"StateToolTransferCallToolTransferDestinationTransferDestinationInferred",
"StateToolTransferCallToolWarmTransferOption",
"StateToolTransferCallToolWarmTransferOptionWarmTransferPrompt",
"StateToolTransferCallToolWarmTransferOptionWarmTransferStaticMessage",
"StateToolTransferCallToolTransferOption",
"StateToolTransferCallToolTransferOptionTransferOptionColdTransfer",
"StateToolTransferCallToolTransferOptionTransferOptionWarmTransfer",
"StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption",
"StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt",
"StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage",
"StateToolCheckAvailabilityCalTool",
"StateToolBookAppointmentCalTool",
"StateToolPressDigitTool",
Expand Down Expand Up @@ -190,23 +196,58 @@ class GeneralToolTransferCallToolTransferDestinationTransferDestinationInferred(
]


class GeneralToolTransferCallToolWarmTransferOptionWarmTransferPrompt(TypedDict, total=False):
class GeneralToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False):
show_transferee_as_caller: Required[bool]
"""
If set to true, will show transferee (the user, not the AI agent) as caller when
transferring, requires the telephony side to support SIP REFER to PSTN. This is
only applicable for cold transfer, so if warm transfer option is specified, this
field will be ignored. Default to false (default to show AI agent as caller).
"""

type: Required[Literal["cold_transfer"]]
"""The type of the transfer."""


class GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt(
TypedDict, total=False
):
prompt: str
"""The prompt to be used for warm handoff. Can contain dynamic variables."""

type: Literal["prompt"]


class GeneralToolTransferCallToolWarmTransferOptionWarmTransferStaticMessage(TypedDict, total=False):
class GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage(
TypedDict, total=False
):
message: str
"""The static message to be used for warm handoff. Can contain dynamic variables."""

type: Literal["static_message"]


GeneralToolTransferCallToolWarmTransferOption: TypeAlias = Union[
GeneralToolTransferCallToolWarmTransferOptionWarmTransferPrompt,
GeneralToolTransferCallToolWarmTransferOptionWarmTransferStaticMessage,
GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[
GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt,
GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage,
]


class GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False):
type: Required[Literal["warm_transfer"]]
"""The type of the transfer."""

public_handoff_option: GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption
"""
If set, when transfer is successful, will say the handoff message to both the
transferee and the agent receiving the transfer. Can leave either a static
message or a dynamic one based on prompt. Set to null to disable warm handoff.
"""


GeneralToolTransferCallToolTransferOption: TypeAlias = Union[
GeneralToolTransferCallToolTransferOptionTransferOptionColdTransfer,
GeneralToolTransferCallToolTransferOptionTransferOptionWarmTransfer,
]


Expand All @@ -220,6 +261,8 @@ class GeneralToolTransferCallTool(TypedDict, total=False):

transfer_destination: Required[GeneralToolTransferCallToolTransferDestination]

transfer_option: Required[GeneralToolTransferCallToolTransferOption]

type: Required[Literal["transfer_call"]]

description: str
Expand All @@ -228,21 +271,6 @@ class GeneralToolTransferCallTool(TypedDict, total=False):
to call the tool.
"""

show_transferee_as_caller: Optional[bool]
"""
If set to true, will show transferee (the user, not the AI agent) as caller when
transferring, requires the telephony side to support SIP REFER to PSTN. This is
only applicable for cold transfer, so if warm transfer option is specified, this
field will be ignored. Default to false (default to show AI agent as caller).
"""

warm_transfer_option: Optional[GeneralToolTransferCallToolWarmTransferOption]
"""If set, when transfer is successful, will perform a warm handoff.

Can leave either a static message or a dynamic one based on prompt. Set to null
to disable warm handoff.
"""


class GeneralToolCheckAvailabilityCalTool(TypedDict, total=False):
cal_api_key: Required[str]
Expand Down Expand Up @@ -525,23 +553,58 @@ class StateToolTransferCallToolTransferDestinationTransferDestinationInferred(Ty
]


class StateToolTransferCallToolWarmTransferOptionWarmTransferPrompt(TypedDict, total=False):
class StateToolTransferCallToolTransferOptionTransferOptionColdTransfer(TypedDict, total=False):
show_transferee_as_caller: Required[bool]
"""
If set to true, will show transferee (the user, not the AI agent) as caller when
transferring, requires the telephony side to support SIP REFER to PSTN. This is
only applicable for cold transfer, so if warm transfer option is specified, this
field will be ignored. Default to false (default to show AI agent as caller).
"""

type: Required[Literal["cold_transfer"]]
"""The type of the transfer."""


class StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt(
TypedDict, total=False
):
prompt: str
"""The prompt to be used for warm handoff. Can contain dynamic variables."""

type: Literal["prompt"]


class StateToolTransferCallToolWarmTransferOptionWarmTransferStaticMessage(TypedDict, total=False):
class StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage(
TypedDict, total=False
):
message: str
"""The static message to be used for warm handoff. Can contain dynamic variables."""

type: Literal["static_message"]


StateToolTransferCallToolWarmTransferOption: TypeAlias = Union[
StateToolTransferCallToolWarmTransferOptionWarmTransferPrompt,
StateToolTransferCallToolWarmTransferOptionWarmTransferStaticMessage,
StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption: TypeAlias = Union[
StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferPrompt,
StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOptionWarmTransferStaticMessage,
]


class StateToolTransferCallToolTransferOptionTransferOptionWarmTransfer(TypedDict, total=False):
type: Required[Literal["warm_transfer"]]
"""The type of the transfer."""

public_handoff_option: StateToolTransferCallToolTransferOptionTransferOptionWarmTransferPublicHandoffOption
"""
If set, when transfer is successful, will say the handoff message to both the
transferee and the agent receiving the transfer. Can leave either a static
message or a dynamic one based on prompt. Set to null to disable warm handoff.
"""


StateToolTransferCallToolTransferOption: TypeAlias = Union[
StateToolTransferCallToolTransferOptionTransferOptionColdTransfer,
StateToolTransferCallToolTransferOptionTransferOptionWarmTransfer,
]


Expand All @@ -555,6 +618,8 @@ class StateToolTransferCallTool(TypedDict, total=False):

transfer_destination: Required[StateToolTransferCallToolTransferDestination]

transfer_option: Required[StateToolTransferCallToolTransferOption]

type: Required[Literal["transfer_call"]]

description: str
Expand All @@ -563,21 +628,6 @@ class StateToolTransferCallTool(TypedDict, total=False):
to call the tool.
"""

show_transferee_as_caller: Optional[bool]
"""
If set to true, will show transferee (the user, not the AI agent) as caller when
transferring, requires the telephony side to support SIP REFER to PSTN. This is
only applicable for cold transfer, so if warm transfer option is specified, this
field will be ignored. Default to false (default to show AI agent as caller).
"""

warm_transfer_option: Optional[StateToolTransferCallToolWarmTransferOption]
"""If set, when transfer is successful, will perform a warm handoff.

Can leave either a static message or a dynamic one based on prompt. Set to null
to disable warm handoff.
"""


class StateToolCheckAvailabilityCalTool(TypedDict, total=False):
cal_api_key: Required[str]
Expand Down
Loading
Loading