Skip to content

Commit 2503154

Browse files
release: 4.142.0 (#302)
* feat: TELAPPS-5698 document conversation relay API shape * release: 4.142.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 116d76e commit 2503154

12 files changed

Lines changed: 1189 additions & 125 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.141.0"
2+
".": "4.142.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1045
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-2f1a1854d307f38a63ec89d1bf32b02c4de3996e08796c7eda08b98a59f6879a.yml
3-
openapi_spec_hash: c82ed2a0dc80695f271c3e56d466c4da
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx/telnyx-65c4b7caac34918e94079d6e5073f448a34a4e39d82d6a2d2c6e280012819f28.yml
3+
openapi_spec_hash: 504d65873a9ed56a7147361bb5606411
44
config_hash: 292f68f00de272998cbaf069c10e2a93

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 4.142.0 (2026-05-27)
4+
5+
Full Changelog: [v4.141.0...v4.142.0](https://github.com/team-telnyx/telnyx-python/compare/v4.141.0...v4.142.0)
6+
7+
### Features
8+
9+
* TELAPPS-5698 document conversation relay API shape ([4573d36](https://github.com/team-telnyx/telnyx-python/commit/4573d364aee2f30da464b2273d128390fa3a8123))
10+
311
## 4.141.0 (2026-05-27)
412

513
Full Changelog: [v4.140.0...v4.141.0](https://github.com/team-telnyx/telnyx-python/compare/v4.140.0...v4.141.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "telnyx"
3-
version = "4.141.0"
3+
version = "4.142.0"
44
description = "The official Python library for the telnyx API"
55
dynamic = ["readme"]
66
license = "MIT"

src/telnyx/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "telnyx"
4-
__version__ = "4.141.0" # x-release-please-version
4+
__version__ = "4.142.0" # x-release-please-version

src/telnyx/resources/calls/actions.py

Lines changed: 150 additions & 38 deletions
Large diffs are not rendered by default.

src/telnyx/resources/calls/calls.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def dial(
9595
client_state: str | Omit = omit,
9696
command_id: str | Omit = omit,
9797
conference_config: call_dial_params.ConferenceConfig | Omit = omit,
98+
conversation_relay_config: call_dial_params.ConversationRelayConfig | Omit = omit,
9899
custom_headers: Iterable[CustomSipHeaderParam] | Omit = omit,
99100
deepfake_detection: call_dial_params.DeepfakeDetection | Omit = omit,
100101
dialogflow_config: DialogflowConfigParam | Omit = omit,
@@ -245,6 +246,13 @@ def dial(
245246
246247
conference_config: Optional configuration parameters to dial new participant into a conference.
247248
249+
conversation_relay_config: Starts a Conversation Relay session automatically when the answered/dialed call
250+
is answered. This embedded shape is supported on `answer` and `dial`. It uses
251+
public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
252+
etc.) and maps them to the underlying Conversation Relay action. `client_state`,
253+
`tts_language`, and `transcription_language` inside this object are ignored; use
254+
the parent command's `client_state` and `command_id` fields instead.
255+
248256
custom_headers: Custom headers to be added to the SIP INVITE.
249257
250258
deepfake_detection: Enables deepfake detection on the call. When enabled, audio from the remote
@@ -423,6 +431,7 @@ def dial(
423431
"client_state": client_state,
424432
"command_id": command_id,
425433
"conference_config": conference_config,
434+
"conversation_relay_config": conversation_relay_config,
426435
"custom_headers": custom_headers,
427436
"deepfake_detection": deepfake_detection,
428437
"dialogflow_config": dialogflow_config,
@@ -558,6 +567,7 @@ async def dial(
558567
client_state: str | Omit = omit,
559568
command_id: str | Omit = omit,
560569
conference_config: call_dial_params.ConferenceConfig | Omit = omit,
570+
conversation_relay_config: call_dial_params.ConversationRelayConfig | Omit = omit,
561571
custom_headers: Iterable[CustomSipHeaderParam] | Omit = omit,
562572
deepfake_detection: call_dial_params.DeepfakeDetection | Omit = omit,
563573
dialogflow_config: DialogflowConfigParam | Omit = omit,
@@ -708,6 +718,13 @@ async def dial(
708718
709719
conference_config: Optional configuration parameters to dial new participant into a conference.
710720
721+
conversation_relay_config: Starts a Conversation Relay session automatically when the answered/dialed call
722+
is answered. This embedded shape is supported on `answer` and `dial`. It uses
723+
public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
724+
etc.) and maps them to the underlying Conversation Relay action. `client_state`,
725+
`tts_language`, and `transcription_language` inside this object are ignored; use
726+
the parent command's `client_state` and `command_id` fields instead.
727+
711728
custom_headers: Custom headers to be added to the SIP INVITE.
712729
713730
deepfake_detection: Enables deepfake detection on the call. When enabled, audio from the remote
@@ -886,6 +903,7 @@ async def dial(
886903
"client_state": client_state,
887904
"command_id": command_id,
888905
"conference_config": conference_config,
906+
"conversation_relay_config": conversation_relay_config,
889907
"custom_headers": custom_headers,
890908
"deepfake_detection": deepfake_detection,
891909
"dialogflow_config": dialogflow_config,

src/telnyx/types/call_dial_params.py

Lines changed: 262 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Dict, Union, Iterable
6-
from typing_extensions import Literal, Required, Annotated, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
@@ -15,14 +15,29 @@
1515
from .stream_bidirectional_mode import StreamBidirectionalMode
1616
from .stream_bidirectional_codec import StreamBidirectionalCodec
1717
from .call_assistant_request_param import CallAssistantRequestParam
18+
from .calls.aws_voice_settings_param import AwsVoiceSettingsParam
19+
from .shared_params.xai_voice_settings import XaiVoiceSettings
1820
from .stream_bidirectional_target_legs import StreamBidirectionalTargetLegs
21+
from .calls.telnyx_voice_settings_param import TelnyxVoiceSettingsParam
22+
from .shared_params.rime_voice_settings import RimeVoiceSettings
23+
from .shared_params.azure_voice_settings import AzureVoiceSettings
1924
from .stream_bidirectional_sampling_rate import StreamBidirectionalSamplingRate
25+
from .shared_params.minimax_voice_settings import MinimaxVoiceSettings
26+
from .shared_params.resemble_voice_settings import ResembleVoiceSettings
27+
from .calls.eleven_labs_voice_settings_param import ElevenLabsVoiceSettingsParam
2028
from .calls.transcription_start_request_param import TranscriptionStartRequestParam
2129

2230
__all__ = [
2331
"CallDialParams",
2432
"AnsweringMachineDetectionConfig",
2533
"ConferenceConfig",
34+
"ConversationRelayConfig",
35+
"ConversationRelayConfigInterruptionSettings",
36+
"ConversationRelayConfigLanguage",
37+
"ConversationRelayConfigLanguageVoiceSettings",
38+
"ConversationRelayConfigLanguageVoiceSettingsInworldVoiceSettings",
39+
"ConversationRelayConfigVoiceSettings",
40+
"ConversationRelayConfigVoiceSettingsInworldVoiceSettings",
2641
"DeepfakeDetection",
2742
"WebhookRetriesPolicies",
2843
]
@@ -134,6 +149,16 @@ class CallDialParams(TypedDict, total=False):
134149
conference_config: ConferenceConfig
135150
"""Optional configuration parameters to dial new participant into a conference."""
136151

152+
conversation_relay_config: ConversationRelayConfig
153+
"""
154+
Starts a Conversation Relay session automatically when the answered/dialed call
155+
is answered. This embedded shape is supported on `answer` and `dial`. It uses
156+
public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
157+
etc.) and maps them to the underlying Conversation Relay action. `client_state`,
158+
`tts_language`, and `transcription_language` inside this object are ignored; use
159+
the parent command's `client_state` and `command_id` fields instead.
160+
"""
161+
137162
custom_headers: Iterable[CustomSipHeaderParam]
138163
"""Custom headers to be added to the SIP INVITE."""
139164

@@ -542,6 +567,242 @@ class ConferenceConfig(TypedDict, total=False):
542567
"""
543568

544569

570+
class ConversationRelayConfigInterruptionSettings(TypedDict, total=False):
571+
"""Settings for handling caller interruptions during Conversation Relay speech."""
572+
573+
enable: bool
574+
"""Legacy boolean form.
575+
576+
`true` is equivalent to `interruptible=any`; `false` is equivalent to
577+
`interruptible=none`.
578+
"""
579+
580+
interruptible: Literal["none", "any", "speech", "dtmf"]
581+
"""Controls when caller input can interrupt assistant speech.
582+
583+
`any` allows speech or DTMF interruptions; `none` disables interruptions;
584+
`speech` allows speech only; `dtmf` allows DTMF only.
585+
"""
586+
587+
interruptible_greeting: Literal["none", "any", "speech", "dtmf"]
588+
"""Controls when caller input can interrupt assistant speech.
589+
590+
`any` allows speech or DTMF interruptions; `none` disables interruptions;
591+
`speech` allows speech only; `dtmf` allows DTMF only.
592+
"""
593+
594+
welcome_greeting_interruptible: Literal["none", "any", "speech", "dtmf"]
595+
"""Controls when caller input can interrupt assistant speech.
596+
597+
`any` allows speech or DTMF interruptions; `none` disables interruptions;
598+
`speech` allows speech only; `dtmf` allows DTMF only.
599+
"""
600+
601+
602+
class ConversationRelayConfigLanguageVoiceSettingsInworldVoiceSettings(TypedDict, total=False):
603+
type: Required[Literal["inworld"]]
604+
"""Voice settings provider type"""
605+
606+
607+
ConversationRelayConfigLanguageVoiceSettings: TypeAlias = Union[
608+
ElevenLabsVoiceSettingsParam,
609+
TelnyxVoiceSettingsParam,
610+
AwsVoiceSettingsParam,
611+
MinimaxVoiceSettings,
612+
AzureVoiceSettings,
613+
RimeVoiceSettings,
614+
ResembleVoiceSettings,
615+
ConversationRelayConfigLanguageVoiceSettingsInworldVoiceSettings,
616+
XaiVoiceSettings,
617+
]
618+
619+
620+
class ConversationRelayConfigLanguage(TypedDict, total=False):
621+
"""Language-specific TTS and transcription settings for Conversation Relay."""
622+
623+
language: Required[str]
624+
"""BCP 47 language tag for this language configuration."""
625+
626+
speech_model: str
627+
"""Conversation Relay speech model.
628+
629+
Prefer `transcription_engine_config.transcription_model` when configuring
630+
speech-to-text.
631+
"""
632+
633+
transcription_engine: Literal[
634+
"Google", "Telnyx", "Deepgram", "Azure", "xAI", "AssemblyAI", "Speechmatics", "Soniox", "A", "B"
635+
]
636+
"""Engine to use for speech recognition.
637+
638+
Legacy values `A` - `Google`, `B` - `Telnyx` are supported for backward
639+
compatibility. When provided in a Conversation Relay language entry, Telnyx
640+
derives `transcription_provider` and `speech_model` for that language.
641+
"""
642+
643+
transcription_engine_config: Dict[str, object]
644+
"""Engine-specific transcription settings for Conversation Relay.
645+
646+
This accepts the same provider-specific options used by the Call Transcription
647+
Start command, such as `transcription_model`, without requiring the engine
648+
discriminator to be repeated inside this object.
649+
"""
650+
651+
transcription_provider: str
652+
"""Conversation Relay transcription provider name.
653+
654+
Prefer `transcription_engine` when configuring speech-to-text.
655+
"""
656+
657+
tts_provider: str
658+
"""Text-to-speech provider for this language.
659+
660+
If omitted and `voice` is provided, Telnyx derives the provider from the voice
661+
identifier.
662+
"""
663+
664+
voice: str
665+
"""Voice identifier for this language."""
666+
667+
voice_settings: ConversationRelayConfigLanguageVoiceSettings
668+
"""The settings associated with the voice selected"""
669+
670+
671+
class ConversationRelayConfigVoiceSettingsInworldVoiceSettings(TypedDict, total=False):
672+
type: Required[Literal["inworld"]]
673+
"""Voice settings provider type"""
674+
675+
676+
ConversationRelayConfigVoiceSettings: TypeAlias = Union[
677+
ElevenLabsVoiceSettingsParam,
678+
TelnyxVoiceSettingsParam,
679+
AwsVoiceSettingsParam,
680+
MinimaxVoiceSettings,
681+
AzureVoiceSettings,
682+
RimeVoiceSettings,
683+
ResembleVoiceSettings,
684+
ConversationRelayConfigVoiceSettingsInworldVoiceSettings,
685+
XaiVoiceSettings,
686+
]
687+
688+
689+
class ConversationRelayConfig(TypedDict, total=False):
690+
"""
691+
Starts a Conversation Relay session automatically when the answered/dialed call is answered. This embedded shape is supported on `answer` and `dial`. It uses public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`, etc.) and maps them to the underlying Conversation Relay action. `client_state`, `tts_language`, and `transcription_language` inside this object are ignored; use the parent command's `client_state` and `command_id` fields instead.
692+
"""
693+
694+
url: Required[str]
695+
"""WebSocket URL for your Conversation Relay server.
696+
697+
Must start with `ws://` or `wss://`.
698+
"""
699+
700+
custom_parameters: Dict[str, object]
701+
"""
702+
Custom key-value parameters forwarded to the relay session as assistant dynamic
703+
variables.
704+
"""
705+
706+
dtmf_detection: bool
707+
"""Enable DTMF detection for the relay session."""
708+
709+
greeting: str
710+
"""Text played when the relay session starts."""
711+
712+
interruptible: Literal["none", "any", "speech", "dtmf"]
713+
"""Controls when caller input can interrupt assistant speech.
714+
715+
`any` allows speech or DTMF interruptions; `none` disables interruptions;
716+
`speech` allows speech only; `dtmf` allows DTMF only.
717+
"""
718+
719+
interruptible_greeting: Literal["none", "any", "speech", "dtmf"]
720+
"""Controls when caller input can interrupt assistant speech.
721+
722+
`any` allows speech or DTMF interruptions; `none` disables interruptions;
723+
`speech` allows speech only; `dtmf` allows DTMF only.
724+
"""
725+
726+
interruption_settings: ConversationRelayConfigInterruptionSettings
727+
"""Settings for handling caller interruptions during Conversation Relay speech."""
728+
729+
language: str
730+
"""Default language for both text-to-speech and speech recognition."""
731+
732+
languages: Iterable[ConversationRelayConfigLanguage]
733+
"""Per-language TTS and transcription settings."""
734+
735+
provider: str
736+
"""Structured voice provider.
737+
738+
Must be supplied together with `structured_provider`.
739+
"""
740+
741+
structured_provider: Dict[str, object]
742+
"""Provider-specific structured voice settings.
743+
744+
Must be supplied together with `provider`; Telnyx sends the value as the nested
745+
provider configuration for Conversation Relay.
746+
"""
747+
748+
transcription_engine: Literal[
749+
"Google", "Telnyx", "Deepgram", "Azure", "xAI", "AssemblyAI", "Speechmatics", "Soniox", "A", "B"
750+
]
751+
"""Engine to use for speech recognition.
752+
753+
Legacy values `A` - `Google`, `B` - `Telnyx` are supported for backward
754+
compatibility. For Conversation Relay, use this field with
755+
`transcription_engine_config`; the `transcription` object is not supported.
756+
"""
757+
758+
transcription_engine_config: Dict[str, object]
759+
"""Engine-specific transcription settings for Conversation Relay.
760+
761+
This accepts the same provider-specific options used by the Call Transcription
762+
Start command, such as `transcription_model`, without requiring the engine
763+
discriminator to be repeated inside this object.
764+
"""
765+
766+
tts_provider: str
767+
"""Text-to-speech provider.
768+
769+
If omitted, Telnyx derives it from `voice` or `provider`.
770+
"""
771+
772+
voice: str
773+
"""The voice to be used by the voice assistant.
774+
775+
Currently we support ElevenLabs, Telnyx and AWS voices.
776+
777+
**Supported Providers:**
778+
779+
- **AWS:** Use `AWS.Polly.<VoiceId>` (e.g., `AWS.Polly.Joanna`). For neural
780+
voices, which provide more realistic, human-like speech, append `-Neural` to
781+
the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the
782+
[available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html)
783+
for compatibility.
784+
- **Azure:** Use `Azure.<VoiceId>. (e.g. Azure.en-CA-ClaraNeural,
785+
Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural,
786+
Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to
787+
[Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).)
788+
- **ElevenLabs:** Use `ElevenLabs.<ModelId>.<VoiceId>` (e.g.,
789+
`ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use
790+
ElevenLabs, you must provide your ElevenLabs API key as an integration secret
791+
under `"voice_settings": {"api_key_ref": "<secret_id>"}`. See
792+
[integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
793+
for details. Check
794+
[available voices](https://elevenlabs.io/docs/api-reference/get-voices).
795+
- **Telnyx:** Use `Telnyx.<model_id>.<voice_id>`
796+
- **Inworld:** Use `Inworld.<ModelId>.<VoiceId>` (e.g., `Inworld.Mini.Loretta`,
797+
`Inworld.Max.Oliver`). Supported models: `Mini`, `Max`.
798+
- **xAI:** Use `xAI.<VoiceId>` (e.g., `xAI.eve`). Available voices: `eve`,
799+
`ara`, `rex`, `sal`, `leo`.
800+
"""
801+
802+
voice_settings: ConversationRelayConfigVoiceSettings
803+
"""The settings associated with the voice selected"""
804+
805+
545806
class DeepfakeDetection(TypedDict, total=False):
546807
"""Enables deepfake detection on the call.
547808

0 commit comments

Comments
 (0)