telnyx 5.119.0 → 5.121.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +6 -0
  5. data/lib/telnyx/models/call_dial_params.rb +551 -1
  6. data/lib/telnyx/models/calls/action_answer_params.rb +556 -1
  7. data/lib/telnyx/models/calls/action_gather_using_speak_params.rb +2 -2
  8. data/lib/telnyx/models/calls/action_speak_params.rb +2 -2
  9. data/lib/telnyx/models/calls/action_start_conversation_relay_params.rb +411 -84
  10. data/lib/telnyx/models/conferences/action_speak_params.rb +2 -2
  11. data/lib/telnyx/models/voice_sdk_call_report_list_params.rb +56 -0
  12. data/lib/telnyx/models/voice_sdk_call_report_list_response.rb +385 -0
  13. data/lib/telnyx/models/voice_sdk_call_report_retrieve_params.rb +20 -0
  14. data/lib/telnyx/models/voice_sdk_call_report_retrieve_response.rb +390 -0
  15. data/lib/telnyx/models.rb +4 -0
  16. data/lib/telnyx/resources/calls/actions.rb +26 -8
  17. data/lib/telnyx/resources/calls.rb +3 -1
  18. data/lib/telnyx/resources/voice_sdk_call_reports.rb +71 -0
  19. data/lib/telnyx/version.rb +1 -1
  20. data/lib/telnyx.rb +5 -0
  21. data/rbi/telnyx/client.rbi +5 -0
  22. data/rbi/telnyx/models/call_dial_params.rbi +1273 -0
  23. data/rbi/telnyx/models/calls/action_answer_params.rbi +1279 -0
  24. data/rbi/telnyx/models/calls/action_gather_using_speak_params.rbi +4 -4
  25. data/rbi/telnyx/models/calls/action_speak_params.rbi +4 -4
  26. data/rbi/telnyx/models/calls/action_start_conversation_relay_params.rbi +928 -133
  27. data/rbi/telnyx/models/conferences/action_speak_params.rbi +4 -4
  28. data/rbi/telnyx/models/voice_sdk_call_report_list_params.rbi +108 -0
  29. data/rbi/telnyx/models/voice_sdk_call_report_list_response.rbi +774 -0
  30. data/rbi/telnyx/models/voice_sdk_call_report_retrieve_params.rbi +38 -0
  31. data/rbi/telnyx/models/voice_sdk_call_report_retrieve_response.rbi +782 -0
  32. data/rbi/telnyx/models.rbi +5 -0
  33. data/rbi/telnyx/resources/calls/actions.rbi +73 -24
  34. data/rbi/telnyx/resources/calls.rbi +9 -0
  35. data/rbi/telnyx/resources/conferences/actions.rbi +2 -2
  36. data/rbi/telnyx/resources/voice_sdk_call_reports.rbi +58 -0
  37. data/sig/telnyx/client.rbs +2 -0
  38. data/sig/telnyx/models/call_dial_params.rbs +440 -0
  39. data/sig/telnyx/models/calls/action_answer_params.rbs +440 -0
  40. data/sig/telnyx/models/calls/action_start_conversation_relay_params.rbs +317 -51
  41. data/sig/telnyx/models/voice_sdk_call_report_list_params.rbs +57 -0
  42. data/sig/telnyx/models/voice_sdk_call_report_list_response.rbs +340 -0
  43. data/sig/telnyx/models/voice_sdk_call_report_retrieve_params.rbs +23 -0
  44. data/sig/telnyx/models/voice_sdk_call_report_retrieve_response.rbs +345 -0
  45. data/sig/telnyx/models.rbs +4 -0
  46. data/sig/telnyx/resources/calls/actions.rbs +12 -3
  47. data/sig/telnyx/resources/calls.rbs +1 -0
  48. data/sig/telnyx/resources/voice_sdk_call_reports.rbs +19 -0
  49. metadata +17 -2
@@ -156,6 +156,25 @@ module Telnyx
156
156
  end
157
157
  attr_writer :conference_config
158
158
 
159
+ # Starts a Conversation Relay session automatically when the answered/dialed call
160
+ # is answered. This embedded shape is supported on `answer` and `dial`. It uses
161
+ # public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
162
+ # etc.) and maps them to the underlying Conversation Relay action. `client_state`,
163
+ # `tts_language`, and `transcription_language` inside this object are ignored; use
164
+ # the parent command's `client_state` and `command_id` fields instead.
165
+ sig do
166
+ returns(T.nilable(Telnyx::CallDialParams::ConversationRelayConfig))
167
+ end
168
+ attr_reader :conversation_relay_config
169
+
170
+ sig do
171
+ params(
172
+ conversation_relay_config:
173
+ Telnyx::CallDialParams::ConversationRelayConfig::OrHash
174
+ ).void
175
+ end
176
+ attr_writer :conversation_relay_config
177
+
159
178
  # Custom headers to be added to the SIP INVITE.
160
179
  sig { returns(T.nilable(T::Array[Telnyx::CustomSipHeader])) }
161
180
  attr_reader :custom_headers
@@ -668,6 +687,8 @@ module Telnyx
668
687
  client_state: String,
669
688
  command_id: String,
670
689
  conference_config: Telnyx::CallDialParams::ConferenceConfig::OrHash,
690
+ conversation_relay_config:
691
+ Telnyx::CallDialParams::ConversationRelayConfig::OrHash,
671
692
  custom_headers: T::Array[Telnyx::CustomSipHeader::OrHash],
672
693
  deepfake_detection: Telnyx::CallDialParams::DeepfakeDetection::OrHash,
673
694
  dialogflow_config: Telnyx::DialogflowConfig::OrHash,
@@ -798,6 +819,13 @@ module Telnyx
798
819
  command_id: nil,
799
820
  # Optional configuration parameters to dial new participant into a conference.
800
821
  conference_config: nil,
822
+ # Starts a Conversation Relay session automatically when the answered/dialed call
823
+ # is answered. This embedded shape is supported on `answer` and `dial`. It uses
824
+ # public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
825
+ # etc.) and maps them to the underlying Conversation Relay action. `client_state`,
826
+ # `tts_language`, and `transcription_language` inside this object are ignored; use
827
+ # the parent command's `client_state` and `command_id` fields instead.
828
+ conversation_relay_config: nil,
801
829
  # Custom headers to be added to the SIP INVITE.
802
830
  custom_headers: nil,
803
831
  # Enables deepfake detection on the call. When enabled, audio from the remote
@@ -975,6 +1003,8 @@ module Telnyx
975
1003
  client_state: String,
976
1004
  command_id: String,
977
1005
  conference_config: Telnyx::CallDialParams::ConferenceConfig,
1006
+ conversation_relay_config:
1007
+ Telnyx::CallDialParams::ConversationRelayConfig,
978
1008
  custom_headers: T::Array[Telnyx::CustomSipHeader],
979
1009
  deepfake_detection: Telnyx::CallDialParams::DeepfakeDetection,
980
1010
  dialogflow_config: Telnyx::DialogflowConfig,
@@ -1636,6 +1666,1249 @@ module Telnyx
1636
1666
  end
1637
1667
  end
1638
1668
 
1669
+ class ConversationRelayConfig < Telnyx::Internal::Type::BaseModel
1670
+ OrHash =
1671
+ T.type_alias do
1672
+ T.any(
1673
+ Telnyx::CallDialParams::ConversationRelayConfig,
1674
+ Telnyx::Internal::AnyHash
1675
+ )
1676
+ end
1677
+
1678
+ # WebSocket URL for your Conversation Relay server. Must start with `ws://` or
1679
+ # `wss://`.
1680
+ sig { returns(String) }
1681
+ attr_accessor :url
1682
+
1683
+ # Custom key-value parameters forwarded to the relay session as assistant dynamic
1684
+ # variables.
1685
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
1686
+ attr_reader :custom_parameters
1687
+
1688
+ sig { params(custom_parameters: T::Hash[Symbol, T.anything]).void }
1689
+ attr_writer :custom_parameters
1690
+
1691
+ # Enable DTMF detection for the relay session.
1692
+ sig { returns(T.nilable(T::Boolean)) }
1693
+ attr_reader :dtmf_detection
1694
+
1695
+ sig { params(dtmf_detection: T::Boolean).void }
1696
+ attr_writer :dtmf_detection
1697
+
1698
+ # Text played when the relay session starts.
1699
+ sig { returns(T.nilable(String)) }
1700
+ attr_reader :greeting
1701
+
1702
+ sig { params(greeting: String).void }
1703
+ attr_writer :greeting
1704
+
1705
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
1706
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
1707
+ # only; `dtmf` allows DTMF only.
1708
+ sig do
1709
+ returns(
1710
+ T.nilable(
1711
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::OrSymbol
1712
+ )
1713
+ )
1714
+ end
1715
+ attr_reader :interruptible
1716
+
1717
+ sig do
1718
+ params(
1719
+ interruptible:
1720
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::OrSymbol
1721
+ ).void
1722
+ end
1723
+ attr_writer :interruptible
1724
+
1725
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
1726
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
1727
+ # only; `dtmf` allows DTMF only.
1728
+ sig do
1729
+ returns(
1730
+ T.nilable(
1731
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::OrSymbol
1732
+ )
1733
+ )
1734
+ end
1735
+ attr_reader :interruptible_greeting
1736
+
1737
+ sig do
1738
+ params(
1739
+ interruptible_greeting:
1740
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::OrSymbol
1741
+ ).void
1742
+ end
1743
+ attr_writer :interruptible_greeting
1744
+
1745
+ # Settings for handling caller interruptions during Conversation Relay speech.
1746
+ sig do
1747
+ returns(
1748
+ T.nilable(
1749
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings
1750
+ )
1751
+ )
1752
+ end
1753
+ attr_reader :interruption_settings
1754
+
1755
+ sig do
1756
+ params(
1757
+ interruption_settings:
1758
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::OrHash
1759
+ ).void
1760
+ end
1761
+ attr_writer :interruption_settings
1762
+
1763
+ # Default language for both text-to-speech and speech recognition.
1764
+ sig { returns(T.nilable(String)) }
1765
+ attr_reader :language
1766
+
1767
+ sig { params(language: String).void }
1768
+ attr_writer :language
1769
+
1770
+ # Per-language TTS and transcription settings.
1771
+ sig do
1772
+ returns(
1773
+ T.nilable(
1774
+ T::Array[
1775
+ Telnyx::CallDialParams::ConversationRelayConfig::Language
1776
+ ]
1777
+ )
1778
+ )
1779
+ end
1780
+ attr_reader :languages
1781
+
1782
+ sig do
1783
+ params(
1784
+ languages:
1785
+ T::Array[
1786
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::OrHash
1787
+ ]
1788
+ ).void
1789
+ end
1790
+ attr_writer :languages
1791
+
1792
+ # Structured voice provider. Must be supplied together with `structured_provider`.
1793
+ sig { returns(T.nilable(String)) }
1794
+ attr_reader :provider
1795
+
1796
+ sig { params(provider: String).void }
1797
+ attr_writer :provider
1798
+
1799
+ # Provider-specific structured voice settings. Must be supplied together with
1800
+ # `provider`; Telnyx sends the value as the nested provider configuration for
1801
+ # Conversation Relay.
1802
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
1803
+ attr_reader :structured_provider
1804
+
1805
+ sig { params(structured_provider: T::Hash[Symbol, T.anything]).void }
1806
+ attr_writer :structured_provider
1807
+
1808
+ # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
1809
+ # `Telnyx` are supported for backward compatibility. For Conversation Relay, use
1810
+ # this field with `transcription_engine_config`; the `transcription` object is not
1811
+ # supported.
1812
+ sig do
1813
+ returns(
1814
+ T.nilable(
1815
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::OrSymbol
1816
+ )
1817
+ )
1818
+ end
1819
+ attr_reader :transcription_engine
1820
+
1821
+ sig do
1822
+ params(
1823
+ transcription_engine:
1824
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::OrSymbol
1825
+ ).void
1826
+ end
1827
+ attr_writer :transcription_engine
1828
+
1829
+ # Engine-specific transcription settings for Conversation Relay. This accepts the
1830
+ # same provider-specific options used by the Call Transcription Start command,
1831
+ # such as `transcription_model`, without requiring the engine discriminator to be
1832
+ # repeated inside this object.
1833
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
1834
+ attr_reader :transcription_engine_config
1835
+
1836
+ sig do
1837
+ params(transcription_engine_config: T::Hash[Symbol, T.anything]).void
1838
+ end
1839
+ attr_writer :transcription_engine_config
1840
+
1841
+ # Text-to-speech provider. If omitted, Telnyx derives it from `voice` or
1842
+ # `provider`.
1843
+ sig { returns(T.nilable(String)) }
1844
+ attr_reader :tts_provider
1845
+
1846
+ sig { params(tts_provider: String).void }
1847
+ attr_writer :tts_provider
1848
+
1849
+ # The voice to be used by the voice assistant. Currently we support ElevenLabs,
1850
+ # Telnyx and AWS voices.
1851
+ #
1852
+ # **Supported Providers:**
1853
+ #
1854
+ # - **AWS:** Use `AWS.Polly.<VoiceId>` (e.g., `AWS.Polly.Joanna`). For neural
1855
+ # voices, which provide more realistic, human-like speech, append `-Neural` to
1856
+ # the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the
1857
+ # [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html)
1858
+ # for compatibility.
1859
+ # - **Azure:** Use `Azure.<VoiceId>. (e.g. Azure.en-CA-ClaraNeural,
1860
+ # Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural,
1861
+ # Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to
1862
+ # [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).)
1863
+ # - **ElevenLabs:** Use `ElevenLabs.<ModelId>.<VoiceId>` (e.g.,
1864
+ # `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use
1865
+ # ElevenLabs, you must provide your ElevenLabs API key as an integration secret
1866
+ # under `"voice_settings": {"api_key_ref": "<secret_id>"}`. See
1867
+ # [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
1868
+ # for details. Check
1869
+ # [available voices](https://elevenlabs.io/docs/api-reference/get-voices).
1870
+ # - **Telnyx:** Use `Telnyx.<model_id>.<voice_id>`
1871
+ # - **Inworld:** Use `Inworld.<ModelId>.<VoiceId>` (e.g., `Inworld.Mini.Loretta`,
1872
+ # `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`.
1873
+ # - **xAI:** Use `xAI.<VoiceId>` (e.g., `xAI.eve`). Available voices: `eve`,
1874
+ # `ara`, `rex`, `sal`, `leo`.
1875
+ sig { returns(T.nilable(String)) }
1876
+ attr_reader :voice
1877
+
1878
+ sig { params(voice: String).void }
1879
+ attr_writer :voice
1880
+
1881
+ # The settings associated with the voice selected
1882
+ sig do
1883
+ returns(
1884
+ T.nilable(
1885
+ T.any(
1886
+ Telnyx::Calls::ElevenLabsVoiceSettings,
1887
+ Telnyx::Calls::TelnyxVoiceSettings,
1888
+ Telnyx::Calls::AwsVoiceSettings,
1889
+ Telnyx::MinimaxVoiceSettings,
1890
+ Telnyx::AzureVoiceSettings,
1891
+ Telnyx::RimeVoiceSettings,
1892
+ Telnyx::ResembleVoiceSettings,
1893
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Inworld,
1894
+ Telnyx::XaiVoiceSettings
1895
+ )
1896
+ )
1897
+ )
1898
+ end
1899
+ attr_reader :voice_settings
1900
+
1901
+ sig do
1902
+ params(
1903
+ voice_settings:
1904
+ T.any(
1905
+ Telnyx::Calls::ElevenLabsVoiceSettings::OrHash,
1906
+ Telnyx::Calls::TelnyxVoiceSettings::OrHash,
1907
+ Telnyx::Calls::AwsVoiceSettings::OrHash,
1908
+ Telnyx::MinimaxVoiceSettings::OrHash,
1909
+ Telnyx::AzureVoiceSettings::OrHash,
1910
+ Telnyx::RimeVoiceSettings::OrHash,
1911
+ Telnyx::ResembleVoiceSettings::OrHash,
1912
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Inworld::OrHash,
1913
+ Telnyx::XaiVoiceSettings::OrHash
1914
+ )
1915
+ ).void
1916
+ end
1917
+ attr_writer :voice_settings
1918
+
1919
+ # Starts a Conversation Relay session automatically when the answered/dialed call
1920
+ # is answered. This embedded shape is supported on `answer` and `dial`. It uses
1921
+ # public field names (`url`, `dtmf_detection`, `greeting`, `voice`, `language`,
1922
+ # etc.) and maps them to the underlying Conversation Relay action. `client_state`,
1923
+ # `tts_language`, and `transcription_language` inside this object are ignored; use
1924
+ # the parent command's `client_state` and `command_id` fields instead.
1925
+ sig do
1926
+ params(
1927
+ url: String,
1928
+ custom_parameters: T::Hash[Symbol, T.anything],
1929
+ dtmf_detection: T::Boolean,
1930
+ greeting: String,
1931
+ interruptible:
1932
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::OrSymbol,
1933
+ interruptible_greeting:
1934
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::OrSymbol,
1935
+ interruption_settings:
1936
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::OrHash,
1937
+ language: String,
1938
+ languages:
1939
+ T::Array[
1940
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::OrHash
1941
+ ],
1942
+ provider: String,
1943
+ structured_provider: T::Hash[Symbol, T.anything],
1944
+ transcription_engine:
1945
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::OrSymbol,
1946
+ transcription_engine_config: T::Hash[Symbol, T.anything],
1947
+ tts_provider: String,
1948
+ voice: String,
1949
+ voice_settings:
1950
+ T.any(
1951
+ Telnyx::Calls::ElevenLabsVoiceSettings::OrHash,
1952
+ Telnyx::Calls::TelnyxVoiceSettings::OrHash,
1953
+ Telnyx::Calls::AwsVoiceSettings::OrHash,
1954
+ Telnyx::MinimaxVoiceSettings::OrHash,
1955
+ Telnyx::AzureVoiceSettings::OrHash,
1956
+ Telnyx::RimeVoiceSettings::OrHash,
1957
+ Telnyx::ResembleVoiceSettings::OrHash,
1958
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Inworld::OrHash,
1959
+ Telnyx::XaiVoiceSettings::OrHash
1960
+ )
1961
+ ).returns(T.attached_class)
1962
+ end
1963
+ def self.new(
1964
+ # WebSocket URL for your Conversation Relay server. Must start with `ws://` or
1965
+ # `wss://`.
1966
+ url:,
1967
+ # Custom key-value parameters forwarded to the relay session as assistant dynamic
1968
+ # variables.
1969
+ custom_parameters: nil,
1970
+ # Enable DTMF detection for the relay session.
1971
+ dtmf_detection: nil,
1972
+ # Text played when the relay session starts.
1973
+ greeting: nil,
1974
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
1975
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
1976
+ # only; `dtmf` allows DTMF only.
1977
+ interruptible: nil,
1978
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
1979
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
1980
+ # only; `dtmf` allows DTMF only.
1981
+ interruptible_greeting: nil,
1982
+ # Settings for handling caller interruptions during Conversation Relay speech.
1983
+ interruption_settings: nil,
1984
+ # Default language for both text-to-speech and speech recognition.
1985
+ language: nil,
1986
+ # Per-language TTS and transcription settings.
1987
+ languages: nil,
1988
+ # Structured voice provider. Must be supplied together with `structured_provider`.
1989
+ provider: nil,
1990
+ # Provider-specific structured voice settings. Must be supplied together with
1991
+ # `provider`; Telnyx sends the value as the nested provider configuration for
1992
+ # Conversation Relay.
1993
+ structured_provider: nil,
1994
+ # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
1995
+ # `Telnyx` are supported for backward compatibility. For Conversation Relay, use
1996
+ # this field with `transcription_engine_config`; the `transcription` object is not
1997
+ # supported.
1998
+ transcription_engine: nil,
1999
+ # Engine-specific transcription settings for Conversation Relay. This accepts the
2000
+ # same provider-specific options used by the Call Transcription Start command,
2001
+ # such as `transcription_model`, without requiring the engine discriminator to be
2002
+ # repeated inside this object.
2003
+ transcription_engine_config: nil,
2004
+ # Text-to-speech provider. If omitted, Telnyx derives it from `voice` or
2005
+ # `provider`.
2006
+ tts_provider: nil,
2007
+ # The voice to be used by the voice assistant. Currently we support ElevenLabs,
2008
+ # Telnyx and AWS voices.
2009
+ #
2010
+ # **Supported Providers:**
2011
+ #
2012
+ # - **AWS:** Use `AWS.Polly.<VoiceId>` (e.g., `AWS.Polly.Joanna`). For neural
2013
+ # voices, which provide more realistic, human-like speech, append `-Neural` to
2014
+ # the `VoiceId` (e.g., `AWS.Polly.Joanna-Neural`). Check the
2015
+ # [available voices](https://docs.aws.amazon.com/polly/latest/dg/available-voices.html)
2016
+ # for compatibility.
2017
+ # - **Azure:** Use `Azure.<VoiceId>. (e.g. Azure.en-CA-ClaraNeural,
2018
+ # Azure.en-CA-LiamNeural, Azure.en-US-BrianMultilingualNeural,
2019
+ # Azure.en-US-Ava:DragonHDLatestNeural. For a complete list of voices, go to
2020
+ # [Azure Voice Gallery](https://speech.microsoft.com/portal/voicegallery).)
2021
+ # - **ElevenLabs:** Use `ElevenLabs.<ModelId>.<VoiceId>` (e.g.,
2022
+ # `ElevenLabs.BaseModel.John`). The `ModelId` part is optional. To use
2023
+ # ElevenLabs, you must provide your ElevenLabs API key as an integration secret
2024
+ # under `"voice_settings": {"api_key_ref": "<secret_id>"}`. See
2025
+ # [integration secrets documentation](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
2026
+ # for details. Check
2027
+ # [available voices](https://elevenlabs.io/docs/api-reference/get-voices).
2028
+ # - **Telnyx:** Use `Telnyx.<model_id>.<voice_id>`
2029
+ # - **Inworld:** Use `Inworld.<ModelId>.<VoiceId>` (e.g., `Inworld.Mini.Loretta`,
2030
+ # `Inworld.Max.Oliver`). Supported models: `Mini`, `Max`.
2031
+ # - **xAI:** Use `xAI.<VoiceId>` (e.g., `xAI.eve`). Available voices: `eve`,
2032
+ # `ara`, `rex`, `sal`, `leo`.
2033
+ voice: nil,
2034
+ # The settings associated with the voice selected
2035
+ voice_settings: nil
2036
+ )
2037
+ end
2038
+
2039
+ sig do
2040
+ override.returns(
2041
+ {
2042
+ url: String,
2043
+ custom_parameters: T::Hash[Symbol, T.anything],
2044
+ dtmf_detection: T::Boolean,
2045
+ greeting: String,
2046
+ interruptible:
2047
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::OrSymbol,
2048
+ interruptible_greeting:
2049
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::OrSymbol,
2050
+ interruption_settings:
2051
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings,
2052
+ language: String,
2053
+ languages:
2054
+ T::Array[
2055
+ Telnyx::CallDialParams::ConversationRelayConfig::Language
2056
+ ],
2057
+ provider: String,
2058
+ structured_provider: T::Hash[Symbol, T.anything],
2059
+ transcription_engine:
2060
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::OrSymbol,
2061
+ transcription_engine_config: T::Hash[Symbol, T.anything],
2062
+ tts_provider: String,
2063
+ voice: String,
2064
+ voice_settings:
2065
+ T.any(
2066
+ Telnyx::Calls::ElevenLabsVoiceSettings,
2067
+ Telnyx::Calls::TelnyxVoiceSettings,
2068
+ Telnyx::Calls::AwsVoiceSettings,
2069
+ Telnyx::MinimaxVoiceSettings,
2070
+ Telnyx::AzureVoiceSettings,
2071
+ Telnyx::RimeVoiceSettings,
2072
+ Telnyx::ResembleVoiceSettings,
2073
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Inworld,
2074
+ Telnyx::XaiVoiceSettings
2075
+ )
2076
+ }
2077
+ )
2078
+ end
2079
+ def to_hash
2080
+ end
2081
+
2082
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2083
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2084
+ # only; `dtmf` allows DTMF only.
2085
+ module Interruptible
2086
+ extend Telnyx::Internal::Type::Enum
2087
+
2088
+ TaggedSymbol =
2089
+ T.type_alias do
2090
+ T.all(
2091
+ Symbol,
2092
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible
2093
+ )
2094
+ end
2095
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2096
+
2097
+ NONE =
2098
+ T.let(
2099
+ :none,
2100
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::TaggedSymbol
2101
+ )
2102
+ ANY =
2103
+ T.let(
2104
+ :any,
2105
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::TaggedSymbol
2106
+ )
2107
+ SPEECH =
2108
+ T.let(
2109
+ :speech,
2110
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::TaggedSymbol
2111
+ )
2112
+ DTMF =
2113
+ T.let(
2114
+ :dtmf,
2115
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::TaggedSymbol
2116
+ )
2117
+
2118
+ sig do
2119
+ override.returns(
2120
+ T::Array[
2121
+ Telnyx::CallDialParams::ConversationRelayConfig::Interruptible::TaggedSymbol
2122
+ ]
2123
+ )
2124
+ end
2125
+ def self.values
2126
+ end
2127
+ end
2128
+
2129
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2130
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2131
+ # only; `dtmf` allows DTMF only.
2132
+ module InterruptibleGreeting
2133
+ extend Telnyx::Internal::Type::Enum
2134
+
2135
+ TaggedSymbol =
2136
+ T.type_alias do
2137
+ T.all(
2138
+ Symbol,
2139
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting
2140
+ )
2141
+ end
2142
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2143
+
2144
+ NONE =
2145
+ T.let(
2146
+ :none,
2147
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::TaggedSymbol
2148
+ )
2149
+ ANY =
2150
+ T.let(
2151
+ :any,
2152
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::TaggedSymbol
2153
+ )
2154
+ SPEECH =
2155
+ T.let(
2156
+ :speech,
2157
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::TaggedSymbol
2158
+ )
2159
+ DTMF =
2160
+ T.let(
2161
+ :dtmf,
2162
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::TaggedSymbol
2163
+ )
2164
+
2165
+ sig do
2166
+ override.returns(
2167
+ T::Array[
2168
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptibleGreeting::TaggedSymbol
2169
+ ]
2170
+ )
2171
+ end
2172
+ def self.values
2173
+ end
2174
+ end
2175
+
2176
+ class InterruptionSettings < Telnyx::Internal::Type::BaseModel
2177
+ OrHash =
2178
+ T.type_alias do
2179
+ T.any(
2180
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings,
2181
+ Telnyx::Internal::AnyHash
2182
+ )
2183
+ end
2184
+
2185
+ # Legacy boolean form. `true` is equivalent to `interruptible=any`; `false` is
2186
+ # equivalent to `interruptible=none`.
2187
+ sig { returns(T.nilable(T::Boolean)) }
2188
+ attr_reader :enable
2189
+
2190
+ sig { params(enable: T::Boolean).void }
2191
+ attr_writer :enable
2192
+
2193
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2194
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2195
+ # only; `dtmf` allows DTMF only.
2196
+ sig do
2197
+ returns(
2198
+ T.nilable(
2199
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::OrSymbol
2200
+ )
2201
+ )
2202
+ end
2203
+ attr_reader :interruptible
2204
+
2205
+ sig do
2206
+ params(
2207
+ interruptible:
2208
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::OrSymbol
2209
+ ).void
2210
+ end
2211
+ attr_writer :interruptible
2212
+
2213
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2214
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2215
+ # only; `dtmf` allows DTMF only.
2216
+ sig do
2217
+ returns(
2218
+ T.nilable(
2219
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::OrSymbol
2220
+ )
2221
+ )
2222
+ end
2223
+ attr_reader :interruptible_greeting
2224
+
2225
+ sig do
2226
+ params(
2227
+ interruptible_greeting:
2228
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::OrSymbol
2229
+ ).void
2230
+ end
2231
+ attr_writer :interruptible_greeting
2232
+
2233
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2234
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2235
+ # only; `dtmf` allows DTMF only.
2236
+ sig do
2237
+ returns(
2238
+ T.nilable(
2239
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::OrSymbol
2240
+ )
2241
+ )
2242
+ end
2243
+ attr_reader :welcome_greeting_interruptible
2244
+
2245
+ sig do
2246
+ params(
2247
+ welcome_greeting_interruptible:
2248
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::OrSymbol
2249
+ ).void
2250
+ end
2251
+ attr_writer :welcome_greeting_interruptible
2252
+
2253
+ # Settings for handling caller interruptions during Conversation Relay speech.
2254
+ sig do
2255
+ params(
2256
+ enable: T::Boolean,
2257
+ interruptible:
2258
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::OrSymbol,
2259
+ interruptible_greeting:
2260
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::OrSymbol,
2261
+ welcome_greeting_interruptible:
2262
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::OrSymbol
2263
+ ).returns(T.attached_class)
2264
+ end
2265
+ def self.new(
2266
+ # Legacy boolean form. `true` is equivalent to `interruptible=any`; `false` is
2267
+ # equivalent to `interruptible=none`.
2268
+ enable: nil,
2269
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2270
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2271
+ # only; `dtmf` allows DTMF only.
2272
+ interruptible: nil,
2273
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2274
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2275
+ # only; `dtmf` allows DTMF only.
2276
+ interruptible_greeting: nil,
2277
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2278
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2279
+ # only; `dtmf` allows DTMF only.
2280
+ welcome_greeting_interruptible: nil
2281
+ )
2282
+ end
2283
+
2284
+ sig do
2285
+ override.returns(
2286
+ {
2287
+ enable: T::Boolean,
2288
+ interruptible:
2289
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::OrSymbol,
2290
+ interruptible_greeting:
2291
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::OrSymbol,
2292
+ welcome_greeting_interruptible:
2293
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::OrSymbol
2294
+ }
2295
+ )
2296
+ end
2297
+ def to_hash
2298
+ end
2299
+
2300
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2301
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2302
+ # only; `dtmf` allows DTMF only.
2303
+ module Interruptible
2304
+ extend Telnyx::Internal::Type::Enum
2305
+
2306
+ TaggedSymbol =
2307
+ T.type_alias do
2308
+ T.all(
2309
+ Symbol,
2310
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible
2311
+ )
2312
+ end
2313
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2314
+
2315
+ NONE =
2316
+ T.let(
2317
+ :none,
2318
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::TaggedSymbol
2319
+ )
2320
+ ANY =
2321
+ T.let(
2322
+ :any,
2323
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::TaggedSymbol
2324
+ )
2325
+ SPEECH =
2326
+ T.let(
2327
+ :speech,
2328
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::TaggedSymbol
2329
+ )
2330
+ DTMF =
2331
+ T.let(
2332
+ :dtmf,
2333
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::TaggedSymbol
2334
+ )
2335
+
2336
+ sig do
2337
+ override.returns(
2338
+ T::Array[
2339
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::Interruptible::TaggedSymbol
2340
+ ]
2341
+ )
2342
+ end
2343
+ def self.values
2344
+ end
2345
+ end
2346
+
2347
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2348
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2349
+ # only; `dtmf` allows DTMF only.
2350
+ module InterruptibleGreeting
2351
+ extend Telnyx::Internal::Type::Enum
2352
+
2353
+ TaggedSymbol =
2354
+ T.type_alias do
2355
+ T.all(
2356
+ Symbol,
2357
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting
2358
+ )
2359
+ end
2360
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2361
+
2362
+ NONE =
2363
+ T.let(
2364
+ :none,
2365
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::TaggedSymbol
2366
+ )
2367
+ ANY =
2368
+ T.let(
2369
+ :any,
2370
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::TaggedSymbol
2371
+ )
2372
+ SPEECH =
2373
+ T.let(
2374
+ :speech,
2375
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::TaggedSymbol
2376
+ )
2377
+ DTMF =
2378
+ T.let(
2379
+ :dtmf,
2380
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::TaggedSymbol
2381
+ )
2382
+
2383
+ sig do
2384
+ override.returns(
2385
+ T::Array[
2386
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::InterruptibleGreeting::TaggedSymbol
2387
+ ]
2388
+ )
2389
+ end
2390
+ def self.values
2391
+ end
2392
+ end
2393
+
2394
+ # Controls when caller input can interrupt assistant speech. `any` allows speech
2395
+ # or DTMF interruptions; `none` disables interruptions; `speech` allows speech
2396
+ # only; `dtmf` allows DTMF only.
2397
+ module WelcomeGreetingInterruptible
2398
+ extend Telnyx::Internal::Type::Enum
2399
+
2400
+ TaggedSymbol =
2401
+ T.type_alias do
2402
+ T.all(
2403
+ Symbol,
2404
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible
2405
+ )
2406
+ end
2407
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2408
+
2409
+ NONE =
2410
+ T.let(
2411
+ :none,
2412
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::TaggedSymbol
2413
+ )
2414
+ ANY =
2415
+ T.let(
2416
+ :any,
2417
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::TaggedSymbol
2418
+ )
2419
+ SPEECH =
2420
+ T.let(
2421
+ :speech,
2422
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::TaggedSymbol
2423
+ )
2424
+ DTMF =
2425
+ T.let(
2426
+ :dtmf,
2427
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::TaggedSymbol
2428
+ )
2429
+
2430
+ sig do
2431
+ override.returns(
2432
+ T::Array[
2433
+ Telnyx::CallDialParams::ConversationRelayConfig::InterruptionSettings::WelcomeGreetingInterruptible::TaggedSymbol
2434
+ ]
2435
+ )
2436
+ end
2437
+ def self.values
2438
+ end
2439
+ end
2440
+ end
2441
+
2442
+ class Language < Telnyx::Internal::Type::BaseModel
2443
+ OrHash =
2444
+ T.type_alias do
2445
+ T.any(
2446
+ Telnyx::CallDialParams::ConversationRelayConfig::Language,
2447
+ Telnyx::Internal::AnyHash
2448
+ )
2449
+ end
2450
+
2451
+ # BCP 47 language tag for this language configuration.
2452
+ sig { returns(String) }
2453
+ attr_accessor :language
2454
+
2455
+ # Conversation Relay speech model. Prefer
2456
+ # `transcription_engine_config.transcription_model` when configuring
2457
+ # speech-to-text.
2458
+ sig { returns(T.nilable(String)) }
2459
+ attr_reader :speech_model
2460
+
2461
+ sig { params(speech_model: String).void }
2462
+ attr_writer :speech_model
2463
+
2464
+ # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
2465
+ # `Telnyx` are supported for backward compatibility. When provided in a
2466
+ # Conversation Relay language entry, Telnyx derives `transcription_provider` and
2467
+ # `speech_model` for that language.
2468
+ sig do
2469
+ returns(
2470
+ T.nilable(
2471
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::OrSymbol
2472
+ )
2473
+ )
2474
+ end
2475
+ attr_reader :transcription_engine
2476
+
2477
+ sig do
2478
+ params(
2479
+ transcription_engine:
2480
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::OrSymbol
2481
+ ).void
2482
+ end
2483
+ attr_writer :transcription_engine
2484
+
2485
+ # Engine-specific transcription settings for Conversation Relay. This accepts the
2486
+ # same provider-specific options used by the Call Transcription Start command,
2487
+ # such as `transcription_model`, without requiring the engine discriminator to be
2488
+ # repeated inside this object.
2489
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
2490
+ attr_reader :transcription_engine_config
2491
+
2492
+ sig do
2493
+ params(
2494
+ transcription_engine_config: T::Hash[Symbol, T.anything]
2495
+ ).void
2496
+ end
2497
+ attr_writer :transcription_engine_config
2498
+
2499
+ # Conversation Relay transcription provider name. Prefer `transcription_engine`
2500
+ # when configuring speech-to-text.
2501
+ sig { returns(T.nilable(String)) }
2502
+ attr_reader :transcription_provider
2503
+
2504
+ sig { params(transcription_provider: String).void }
2505
+ attr_writer :transcription_provider
2506
+
2507
+ # Text-to-speech provider for this language. If omitted and `voice` is provided,
2508
+ # Telnyx derives the provider from the voice identifier.
2509
+ sig { returns(T.nilable(String)) }
2510
+ attr_reader :tts_provider
2511
+
2512
+ sig { params(tts_provider: String).void }
2513
+ attr_writer :tts_provider
2514
+
2515
+ # Voice identifier for this language.
2516
+ sig { returns(T.nilable(String)) }
2517
+ attr_reader :voice
2518
+
2519
+ sig { params(voice: String).void }
2520
+ attr_writer :voice
2521
+
2522
+ # The settings associated with the voice selected
2523
+ sig do
2524
+ returns(
2525
+ T.nilable(
2526
+ T.any(
2527
+ Telnyx::Calls::ElevenLabsVoiceSettings,
2528
+ Telnyx::Calls::TelnyxVoiceSettings,
2529
+ Telnyx::Calls::AwsVoiceSettings,
2530
+ Telnyx::MinimaxVoiceSettings,
2531
+ Telnyx::AzureVoiceSettings,
2532
+ Telnyx::RimeVoiceSettings,
2533
+ Telnyx::ResembleVoiceSettings,
2534
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Inworld,
2535
+ Telnyx::XaiVoiceSettings
2536
+ )
2537
+ )
2538
+ )
2539
+ end
2540
+ attr_reader :voice_settings
2541
+
2542
+ sig do
2543
+ params(
2544
+ voice_settings:
2545
+ T.any(
2546
+ Telnyx::Calls::ElevenLabsVoiceSettings::OrHash,
2547
+ Telnyx::Calls::TelnyxVoiceSettings::OrHash,
2548
+ Telnyx::Calls::AwsVoiceSettings::OrHash,
2549
+ Telnyx::MinimaxVoiceSettings::OrHash,
2550
+ Telnyx::AzureVoiceSettings::OrHash,
2551
+ Telnyx::RimeVoiceSettings::OrHash,
2552
+ Telnyx::ResembleVoiceSettings::OrHash,
2553
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Inworld::OrHash,
2554
+ Telnyx::XaiVoiceSettings::OrHash
2555
+ )
2556
+ ).void
2557
+ end
2558
+ attr_writer :voice_settings
2559
+
2560
+ # Language-specific TTS and transcription settings for Conversation Relay.
2561
+ sig do
2562
+ params(
2563
+ language: String,
2564
+ speech_model: String,
2565
+ transcription_engine:
2566
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::OrSymbol,
2567
+ transcription_engine_config: T::Hash[Symbol, T.anything],
2568
+ transcription_provider: String,
2569
+ tts_provider: String,
2570
+ voice: String,
2571
+ voice_settings:
2572
+ T.any(
2573
+ Telnyx::Calls::ElevenLabsVoiceSettings::OrHash,
2574
+ Telnyx::Calls::TelnyxVoiceSettings::OrHash,
2575
+ Telnyx::Calls::AwsVoiceSettings::OrHash,
2576
+ Telnyx::MinimaxVoiceSettings::OrHash,
2577
+ Telnyx::AzureVoiceSettings::OrHash,
2578
+ Telnyx::RimeVoiceSettings::OrHash,
2579
+ Telnyx::ResembleVoiceSettings::OrHash,
2580
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Inworld::OrHash,
2581
+ Telnyx::XaiVoiceSettings::OrHash
2582
+ )
2583
+ ).returns(T.attached_class)
2584
+ end
2585
+ def self.new(
2586
+ # BCP 47 language tag for this language configuration.
2587
+ language:,
2588
+ # Conversation Relay speech model. Prefer
2589
+ # `transcription_engine_config.transcription_model` when configuring
2590
+ # speech-to-text.
2591
+ speech_model: nil,
2592
+ # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
2593
+ # `Telnyx` are supported for backward compatibility. When provided in a
2594
+ # Conversation Relay language entry, Telnyx derives `transcription_provider` and
2595
+ # `speech_model` for that language.
2596
+ transcription_engine: nil,
2597
+ # Engine-specific transcription settings for Conversation Relay. This accepts the
2598
+ # same provider-specific options used by the Call Transcription Start command,
2599
+ # such as `transcription_model`, without requiring the engine discriminator to be
2600
+ # repeated inside this object.
2601
+ transcription_engine_config: nil,
2602
+ # Conversation Relay transcription provider name. Prefer `transcription_engine`
2603
+ # when configuring speech-to-text.
2604
+ transcription_provider: nil,
2605
+ # Text-to-speech provider for this language. If omitted and `voice` is provided,
2606
+ # Telnyx derives the provider from the voice identifier.
2607
+ tts_provider: nil,
2608
+ # Voice identifier for this language.
2609
+ voice: nil,
2610
+ # The settings associated with the voice selected
2611
+ voice_settings: nil
2612
+ )
2613
+ end
2614
+
2615
+ sig do
2616
+ override.returns(
2617
+ {
2618
+ language: String,
2619
+ speech_model: String,
2620
+ transcription_engine:
2621
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::OrSymbol,
2622
+ transcription_engine_config: T::Hash[Symbol, T.anything],
2623
+ transcription_provider: String,
2624
+ tts_provider: String,
2625
+ voice: String,
2626
+ voice_settings:
2627
+ T.any(
2628
+ Telnyx::Calls::ElevenLabsVoiceSettings,
2629
+ Telnyx::Calls::TelnyxVoiceSettings,
2630
+ Telnyx::Calls::AwsVoiceSettings,
2631
+ Telnyx::MinimaxVoiceSettings,
2632
+ Telnyx::AzureVoiceSettings,
2633
+ Telnyx::RimeVoiceSettings,
2634
+ Telnyx::ResembleVoiceSettings,
2635
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Inworld,
2636
+ Telnyx::XaiVoiceSettings
2637
+ )
2638
+ }
2639
+ )
2640
+ end
2641
+ def to_hash
2642
+ end
2643
+
2644
+ # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
2645
+ # `Telnyx` are supported for backward compatibility. When provided in a
2646
+ # Conversation Relay language entry, Telnyx derives `transcription_provider` and
2647
+ # `speech_model` for that language.
2648
+ module TranscriptionEngine
2649
+ extend Telnyx::Internal::Type::Enum
2650
+
2651
+ TaggedSymbol =
2652
+ T.type_alias do
2653
+ T.all(
2654
+ Symbol,
2655
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine
2656
+ )
2657
+ end
2658
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2659
+
2660
+ GOOGLE =
2661
+ T.let(
2662
+ :Google,
2663
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2664
+ )
2665
+ TELNYX =
2666
+ T.let(
2667
+ :Telnyx,
2668
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2669
+ )
2670
+ DEEPGRAM =
2671
+ T.let(
2672
+ :Deepgram,
2673
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2674
+ )
2675
+ AZURE =
2676
+ T.let(
2677
+ :Azure,
2678
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2679
+ )
2680
+ X_AI =
2681
+ T.let(
2682
+ :xAI,
2683
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2684
+ )
2685
+ ASSEMBLY_AI =
2686
+ T.let(
2687
+ :AssemblyAI,
2688
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2689
+ )
2690
+ SPEECHMATICS =
2691
+ T.let(
2692
+ :Speechmatics,
2693
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2694
+ )
2695
+ SONIOX =
2696
+ T.let(
2697
+ :Soniox,
2698
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2699
+ )
2700
+ A =
2701
+ T.let(
2702
+ :A,
2703
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2704
+ )
2705
+ B =
2706
+ T.let(
2707
+ :B,
2708
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2709
+ )
2710
+
2711
+ sig do
2712
+ override.returns(
2713
+ T::Array[
2714
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::TranscriptionEngine::TaggedSymbol
2715
+ ]
2716
+ )
2717
+ end
2718
+ def self.values
2719
+ end
2720
+ end
2721
+
2722
+ # The settings associated with the voice selected
2723
+ module VoiceSettings
2724
+ extend Telnyx::Internal::Type::Union
2725
+
2726
+ Variants =
2727
+ T.type_alias do
2728
+ T.any(
2729
+ Telnyx::Calls::ElevenLabsVoiceSettings,
2730
+ Telnyx::Calls::TelnyxVoiceSettings,
2731
+ Telnyx::Calls::AwsVoiceSettings,
2732
+ Telnyx::MinimaxVoiceSettings,
2733
+ Telnyx::AzureVoiceSettings,
2734
+ Telnyx::RimeVoiceSettings,
2735
+ Telnyx::ResembleVoiceSettings,
2736
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Inworld,
2737
+ Telnyx::XaiVoiceSettings
2738
+ )
2739
+ end
2740
+
2741
+ class Inworld < Telnyx::Internal::Type::BaseModel
2742
+ OrHash =
2743
+ T.type_alias do
2744
+ T.any(
2745
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Inworld,
2746
+ Telnyx::Internal::AnyHash
2747
+ )
2748
+ end
2749
+
2750
+ # Voice settings provider type
2751
+ sig { returns(Symbol) }
2752
+ attr_accessor :type
2753
+
2754
+ sig { params(type: Symbol).returns(T.attached_class) }
2755
+ def self.new(
2756
+ # Voice settings provider type
2757
+ type: :inworld
2758
+ )
2759
+ end
2760
+
2761
+ sig { override.returns({ type: Symbol }) }
2762
+ def to_hash
2763
+ end
2764
+ end
2765
+
2766
+ sig do
2767
+ override.returns(
2768
+ T::Array[
2769
+ Telnyx::CallDialParams::ConversationRelayConfig::Language::VoiceSettings::Variants
2770
+ ]
2771
+ )
2772
+ end
2773
+ def self.variants
2774
+ end
2775
+ end
2776
+ end
2777
+
2778
+ # Engine to use for speech recognition. Legacy values `A` - `Google`, `B` -
2779
+ # `Telnyx` are supported for backward compatibility. For Conversation Relay, use
2780
+ # this field with `transcription_engine_config`; the `transcription` object is not
2781
+ # supported.
2782
+ module TranscriptionEngine
2783
+ extend Telnyx::Internal::Type::Enum
2784
+
2785
+ TaggedSymbol =
2786
+ T.type_alias do
2787
+ T.all(
2788
+ Symbol,
2789
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine
2790
+ )
2791
+ end
2792
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2793
+
2794
+ GOOGLE =
2795
+ T.let(
2796
+ :Google,
2797
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2798
+ )
2799
+ TELNYX =
2800
+ T.let(
2801
+ :Telnyx,
2802
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2803
+ )
2804
+ DEEPGRAM =
2805
+ T.let(
2806
+ :Deepgram,
2807
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2808
+ )
2809
+ AZURE =
2810
+ T.let(
2811
+ :Azure,
2812
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2813
+ )
2814
+ X_AI =
2815
+ T.let(
2816
+ :xAI,
2817
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2818
+ )
2819
+ ASSEMBLY_AI =
2820
+ T.let(
2821
+ :AssemblyAI,
2822
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2823
+ )
2824
+ SPEECHMATICS =
2825
+ T.let(
2826
+ :Speechmatics,
2827
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2828
+ )
2829
+ SONIOX =
2830
+ T.let(
2831
+ :Soniox,
2832
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2833
+ )
2834
+ A =
2835
+ T.let(
2836
+ :A,
2837
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2838
+ )
2839
+ B =
2840
+ T.let(
2841
+ :B,
2842
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2843
+ )
2844
+
2845
+ sig do
2846
+ override.returns(
2847
+ T::Array[
2848
+ Telnyx::CallDialParams::ConversationRelayConfig::TranscriptionEngine::TaggedSymbol
2849
+ ]
2850
+ )
2851
+ end
2852
+ def self.values
2853
+ end
2854
+ end
2855
+
2856
+ # The settings associated with the voice selected
2857
+ module VoiceSettings
2858
+ extend Telnyx::Internal::Type::Union
2859
+
2860
+ Variants =
2861
+ T.type_alias do
2862
+ T.any(
2863
+ Telnyx::Calls::ElevenLabsVoiceSettings,
2864
+ Telnyx::Calls::TelnyxVoiceSettings,
2865
+ Telnyx::Calls::AwsVoiceSettings,
2866
+ Telnyx::MinimaxVoiceSettings,
2867
+ Telnyx::AzureVoiceSettings,
2868
+ Telnyx::RimeVoiceSettings,
2869
+ Telnyx::ResembleVoiceSettings,
2870
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Inworld,
2871
+ Telnyx::XaiVoiceSettings
2872
+ )
2873
+ end
2874
+
2875
+ class Inworld < Telnyx::Internal::Type::BaseModel
2876
+ OrHash =
2877
+ T.type_alias do
2878
+ T.any(
2879
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Inworld,
2880
+ Telnyx::Internal::AnyHash
2881
+ )
2882
+ end
2883
+
2884
+ # Voice settings provider type
2885
+ sig { returns(Symbol) }
2886
+ attr_accessor :type
2887
+
2888
+ sig { params(type: Symbol).returns(T.attached_class) }
2889
+ def self.new(
2890
+ # Voice settings provider type
2891
+ type: :inworld
2892
+ )
2893
+ end
2894
+
2895
+ sig { override.returns({ type: Symbol }) }
2896
+ def to_hash
2897
+ end
2898
+ end
2899
+
2900
+ sig do
2901
+ override.returns(
2902
+ T::Array[
2903
+ Telnyx::CallDialParams::ConversationRelayConfig::VoiceSettings::Variants
2904
+ ]
2905
+ )
2906
+ end
2907
+ def self.variants
2908
+ end
2909
+ end
2910
+ end
2911
+
1639
2912
  class DeepfakeDetection < Telnyx::Internal::Type::BaseModel
1640
2913
  OrHash =
1641
2914
  T.type_alias do