telnyx 5.7.0 → 5.7.1

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/models/ai/audio_transcribe_params.rb +32 -5
  5. data/lib/telnyx/models/calls/action_start_recording_params.rb +122 -7
  6. data/lib/telnyx/models/private_wireless_gateway_status.rb +3 -2
  7. data/lib/telnyx/models/sim_card_list_params.rb +11 -3
  8. data/lib/telnyx/models/texml/accounts/conference_retrieve_recordings_response.rb +9 -1
  9. data/lib/telnyx/models/texml/accounts/conferences/participant_participants_response.rb +9 -1
  10. data/lib/telnyx/models/texml/accounts/conferences/participant_retrieve_participants_response.rb +9 -1
  11. data/lib/telnyx/models/texml/accounts/conferences/participant_retrieve_response.rb +9 -1
  12. data/lib/telnyx/models/texml/accounts/conferences/participant_update_response.rb +9 -1
  13. data/lib/telnyx/resources/ai/audio.rb +5 -1
  14. data/lib/telnyx/resources/calls/actions.rb +2 -2
  15. data/lib/telnyx/resources/texml/calls.rb +0 -130
  16. data/lib/telnyx/version.rb +1 -1
  17. data/lib/telnyx.rb +0 -4
  18. data/rbi/telnyx/models/ai/audio_transcribe_params.rbi +53 -7
  19. data/rbi/telnyx/models/calls/action_start_recording_params.rbi +565 -9
  20. data/rbi/telnyx/models/private_wireless_gateway_status.rbi +4 -2
  21. data/rbi/telnyx/models/sim_card_list_params.rbi +14 -3
  22. data/rbi/telnyx/models/texml/accounts/conference_retrieve_recordings_response.rbi +11 -0
  23. data/rbi/telnyx/models/texml/accounts/conferences/participant_participants_response.rbi +11 -0
  24. data/rbi/telnyx/models/texml/accounts/conferences/participant_retrieve_participants_response.rbi +11 -0
  25. data/rbi/telnyx/models/texml/accounts/conferences/participant_retrieve_response.rbi +11 -0
  26. data/rbi/telnyx/models/texml/accounts/conferences/participant_update_response.rbi +11 -0
  27. data/rbi/telnyx/resources/ai/audio.rbi +18 -3
  28. data/rbi/telnyx/resources/calls/actions.rbi +5 -3
  29. data/rbi/telnyx/resources/sim_cards.rbi +1 -1
  30. data/rbi/telnyx/resources/texml/calls.rbi +0 -180
  31. data/sig/telnyx/models/ai/audio_transcribe_params.rbs +18 -1
  32. data/sig/telnyx/models/calls/action_start_recording_params.rbs +219 -5
  33. data/sig/telnyx/models/sim_card_list_params.rbs +7 -0
  34. data/sig/telnyx/models/texml/accounts/conference_retrieve_recordings_response.rbs +7 -0
  35. data/sig/telnyx/models/texml/accounts/conferences/participant_participants_response.rbs +7 -0
  36. data/sig/telnyx/models/texml/accounts/conferences/participant_retrieve_participants_response.rbs +7 -0
  37. data/sig/telnyx/models/texml/accounts/conferences/participant_retrieve_response.rbs +7 -0
  38. data/sig/telnyx/models/texml/accounts/conferences/participant_update_response.rbs +7 -0
  39. data/sig/telnyx/resources/ai/audio.rbs +2 -0
  40. data/sig/telnyx/resources/calls/actions.rbs +1 -1
  41. data/sig/telnyx/resources/texml/calls.rbs +0 -49
  42. metadata +2 -14
  43. data/lib/telnyx/models/texml/call_initiate_params.rb +0 -427
  44. data/lib/telnyx/models/texml/call_initiate_response.rb +0 -41
  45. data/lib/telnyx/models/texml/call_update_params.rb +0 -16
  46. data/lib/telnyx/models/texml/call_update_response.rb +0 -35
  47. data/rbi/telnyx/models/texml/call_initiate_params.rbi +0 -886
  48. data/rbi/telnyx/models/texml/call_initiate_response.rbi +0 -85
  49. data/rbi/telnyx/models/texml/call_update_params.rbi +0 -29
  50. data/rbi/telnyx/models/texml/call_update_response.rbi +0 -75
  51. data/sig/telnyx/models/texml/call_initiate_params.rbs +0 -371
  52. data/sig/telnyx/models/texml/call_initiate_response.rbs +0 -44
  53. data/sig/telnyx/models/texml/call_update_params.rbs +0 -17
  54. data/sig/telnyx/models/texml/call_update_response.rbs +0 -40
@@ -4,136 +4,6 @@ module Telnyx
4
4
  module Resources
5
5
  class Texml
6
6
  class Calls
7
- # Some parameter documentations has been truncated, see
8
- # {Telnyx::Models::Texml::CallUpdateParams} for more details.
9
- #
10
- # Update TeXML call. Please note that the keys present in the payload MUST BE
11
- # formatted in CamelCase as specified in the example.
12
- #
13
- # @overload update(call_sid, fallback_method: nil, fallback_url: nil, method_: nil, status: nil, status_callback: nil, status_callback_method: nil, texml: nil, url: nil, request_options: {})
14
- #
15
- # @param call_sid [String] The CallSid that identifies the call to update.
16
- #
17
- # @param fallback_method [Symbol, Telnyx::Models::Texml::Accounts::UpdateCall::FallbackMethod] HTTP request type used for `FallbackUrl`.
18
- #
19
- # @param fallback_url [String] A failover URL for which Telnyx will retrieve the TeXML call instructions if the
20
- #
21
- # @param method_ [Symbol, Telnyx::Models::Texml::Accounts::UpdateCall::Method] HTTP request type used for `Url`.
22
- #
23
- # @param status [String] The value to set the call status to. Setting the status to completed ends the ca
24
- #
25
- # @param status_callback [String] URL destination for Telnyx to send status callback events to for the call.
26
- #
27
- # @param status_callback_method [Symbol, Telnyx::Models::Texml::Accounts::UpdateCall::StatusCallbackMethod] HTTP request type used for `StatusCallback`.
28
- #
29
- # @param texml [String] TeXML to replace the current one with.
30
- #
31
- # @param url [String] The URL where TeXML will make a request to retrieve a new set of TeXML instructi
32
- #
33
- # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
34
- #
35
- # @return [Telnyx::Models::Texml::CallUpdateResponse]
36
- #
37
- # @see Telnyx::Models::Texml::CallUpdateParams
38
- def update(call_sid, params = {})
39
- parsed, options = Telnyx::Texml::CallUpdateParams.dump_request(params)
40
- @client.request(
41
- method: :post,
42
- path: ["texml/calls/%1$s/update", call_sid],
43
- body: parsed,
44
- model: Telnyx::Models::Texml::CallUpdateResponse,
45
- options: options
46
- )
47
- end
48
-
49
- # Some parameter documentations has been truncated, see
50
- # {Telnyx::Models::Texml::CallInitiateParams} for more details.
51
- #
52
- # Initiate an outbound TeXML call. Telnyx will request TeXML from the XML Request
53
- # URL configured for the connection in the Mission Control Portal.
54
- #
55
- # @overload initiate(application_id, from:, to:, async_amd: nil, async_amd_status_callback: nil, async_amd_status_callback_method: nil, caller_id: nil, cancel_playback_on_detect_message_end: nil, cancel_playback_on_machine_detection: nil, detection_mode: nil, fallback_url: nil, machine_detection: nil, machine_detection_silence_timeout: nil, machine_detection_speech_end_threshold: nil, machine_detection_speech_threshold: nil, machine_detection_timeout: nil, preferred_codecs: nil, record: nil, recording_channels: nil, recording_status_callback: nil, recording_status_callback_event: nil, recording_status_callback_method: nil, recording_timeout: nil, recording_track: nil, sip_auth_password: nil, sip_auth_username: nil, status_callback: nil, status_callback_event: nil, status_callback_method: nil, trim: nil, url: nil, url_method: nil, request_options: {})
56
- #
57
- # @param application_id [String] The ID of the TeXML application used for the call.
58
- #
59
- # @param from [String] The phone number of the party that initiated the call. Phone numbers are formatt
60
- #
61
- # @param to [String] The phone number of the called party. Phone numbers are formatted with a `+` and
62
- #
63
- # @param async_amd [Boolean] Select whether to perform answering machine detection in the background. By defa
64
- #
65
- # @param async_amd_status_callback [String] URL destination for Telnyx to send AMD callback events to for the call.
66
- #
67
- # @param async_amd_status_callback_method [Symbol, Telnyx::Models::Texml::CallInitiateParams::AsyncAmdStatusCallbackMethod] HTTP request type used for `AsyncAmdStatusCallback`. The default value is inheri
68
- #
69
- # @param caller_id [String] To be used as the caller id name (SIP From Display Name) presented to the destin
70
- #
71
- # @param cancel_playback_on_detect_message_end [Boolean] Whether to cancel ongoing playback on `greeting ended` detection. Defaults to `t
72
- #
73
- # @param cancel_playback_on_machine_detection [Boolean] Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
74
- #
75
- # @param detection_mode [Symbol, Telnyx::Models::Texml::CallInitiateParams::DetectionMode] Allows you to chose between Premium and Standard detections.
76
- #
77
- # @param fallback_url [String] A failover URL for which Telnyx will retrieve the TeXML call instructions if the
78
- #
79
- # @param machine_detection [Symbol, Telnyx::Models::Texml::CallInitiateParams::MachineDetection] Enables Answering Machine Detection.
80
- #
81
- # @param machine_detection_silence_timeout [Integer] If initial silence duration is greater than this value, consider it a machine. I
82
- #
83
- # @param machine_detection_speech_end_threshold [Integer] Silence duration threshold after a greeting message or voice for it be considere
84
- #
85
- # @param machine_detection_speech_threshold [Integer] Maximum threshold of a human greeting. If greeting longer than this value, consi
86
- #
87
- # @param machine_detection_timeout [Integer] Maximum timeout threshold in milliseconds for overall detection.
88
- #
89
- # @param preferred_codecs [String] The list of comma-separated codecs to be offered on a call.
90
- #
91
- # @param record [Boolean] Whether to record the entire participant's call leg. Defaults to `false`.
92
- #
93
- # @param recording_channels [Symbol, Telnyx::Models::Texml::CallInitiateParams::RecordingChannels] The number of channels in the final recording. Defaults to `mono`.
94
- #
95
- # @param recording_status_callback [String] The URL the recording callbacks will be sent to.
96
- #
97
- # @param recording_status_callback_event [String] The changes to the recording's state that should generate a call to `RecoridngSt
98
- #
99
- # @param recording_status_callback_method [Symbol, Telnyx::Models::Texml::CallInitiateParams::RecordingStatusCallbackMethod] HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
100
- #
101
- # @param recording_timeout [Integer] The number of seconds that Telnyx will wait for the recording to be stopped if s
102
- #
103
- # @param recording_track [Symbol, Telnyx::Models::Texml::CallInitiateParams::RecordingTrack] The audio track to record for the call. The default is `both`.
104
- #
105
- # @param sip_auth_password [String] The password to use for SIP authentication.
106
- #
107
- # @param sip_auth_username [String] The username to use for SIP authentication.
108
- #
109
- # @param status_callback [String] URL destination for Telnyx to send status callback events to for the call.
110
- #
111
- # @param status_callback_event [Symbol, Telnyx::Models::Texml::CallInitiateParams::StatusCallbackEvent] The call events for which Telnyx should send a webhook. Multiple events can be d
112
- #
113
- # @param status_callback_method [Symbol, Telnyx::Models::Texml::CallInitiateParams::StatusCallbackMethod] HTTP request type used for `StatusCallback`.
114
- #
115
- # @param trim [Symbol, Telnyx::Models::Texml::CallInitiateParams::Trim] Whether to trim any leading and trailing silence from the recording. Defaults to
116
- #
117
- # @param url [String] The URL from which Telnyx will retrieve the TeXML call instructions.
118
- #
119
- # @param url_method [Symbol, Telnyx::Models::Texml::CallInitiateParams::URLMethod] HTTP request type used for `Url`. The default value is inherited from TeXML Appl
120
- #
121
- # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
122
- #
123
- # @return [Telnyx::Models::Texml::CallInitiateResponse]
124
- #
125
- # @see Telnyx::Models::Texml::CallInitiateParams
126
- def initiate(application_id, params)
127
- parsed, options = Telnyx::Texml::CallInitiateParams.dump_request(params)
128
- @client.request(
129
- method: :post,
130
- path: ["texml/calls/%1$s", application_id],
131
- body: parsed,
132
- model: Telnyx::Models::Texml::CallInitiateResponse,
133
- options: options
134
- )
135
- end
136
-
137
7
  # @api private
138
8
  #
139
9
  # @param client [Telnyx::Client]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Telnyx
4
- VERSION = "5.7.0"
4
+ VERSION = "5.7.1"
5
5
  end
data/lib/telnyx.rb CHANGED
@@ -1837,10 +1837,6 @@ require_relative "telnyx/models/texml/accounts/recordings/json_retrieve_recordin
1837
1837
  require_relative "telnyx/models/texml/accounts/transcriptions/json_delete_recording_transcription_sid_json_params"
1838
1838
  require_relative "telnyx/models/texml/accounts/transcriptions/json_retrieve_recording_transcription_sid_json_params"
1839
1839
  require_relative "telnyx/models/texml/accounts/transcriptions/json_retrieve_recording_transcription_sid_json_response"
1840
- require_relative "telnyx/models/texml/call_initiate_params"
1841
- require_relative "telnyx/models/texml/call_initiate_response"
1842
- require_relative "telnyx/models/texml/call_update_params"
1843
- require_relative "telnyx/models/texml/call_update_response"
1844
1840
  require_relative "telnyx/models/texml/texml_get_call_recording_response_body"
1845
1841
  require_relative "telnyx/models/texml/texml_recording_subresources_uris"
1846
1842
  require_relative "telnyx/models/texml_application"
@@ -14,13 +14,15 @@ module Telnyx
14
14
 
15
15
  # ID of the model to use. `distil-whisper/distil-large-v2` is lower latency but
16
16
  # English-only. `openai/whisper-large-v3-turbo` is multi-lingual but slightly
17
- # higher latency.
17
+ # higher latency. `deepgram/nova-3` supports English variants (en, en-US, en-GB,
18
+ # en-AU, en-NZ, en-IN) and only accepts mp3/wav files.
18
19
  sig { returns(Telnyx::AI::AudioTranscribeParams::Model::OrSymbol) }
19
20
  attr_accessor :model
20
21
 
21
22
  # The audio file object to transcribe, in one of these formats: flac, mp3, mp4,
22
23
  # mpeg, mpga, m4a, ogg, wav, or webm. File uploads are limited to 100 MB. Cannot
23
- # be used together with `file_url`
24
+ # be used together with `file_url`. Note: `deepgram/nova-3` only supports mp3 and
25
+ # wav formats.
24
26
  sig { returns(T.nilable(Telnyx::Internal::FileInput)) }
25
27
  attr_reader :file
26
28
 
@@ -29,13 +31,34 @@ module Telnyx
29
31
 
30
32
  # Link to audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a,
31
33
  # ogg, wav, or webm. Support for hosted files is limited to 100MB. Cannot be used
32
- # together with `file`
34
+ # together with `file`. Note: `deepgram/nova-3` only supports mp3 and wav formats.
33
35
  sig { returns(T.nilable(String)) }
34
36
  attr_reader :file_url
35
37
 
36
38
  sig { params(file_url: String).void }
37
39
  attr_writer :file_url
38
40
 
41
+ # The language of the audio to be transcribed. For `deepgram/nova-3`, only English
42
+ # variants are supported: `en`, `en-US`, `en-GB`, `en-AU`, `en-NZ`, `en-IN`. For
43
+ # `openai/whisper-large-v3-turbo`, supports multiple languages.
44
+ # `distil-whisper/distil-large-v2` does not support language parameter.
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :language
47
+
48
+ sig { params(language: String).void }
49
+ attr_writer :language
50
+
51
+ # Additional model-specific configuration parameters. Only allowed with
52
+ # `deepgram/nova-3` model. Can include Deepgram-specific options such as
53
+ # `smart_format`, `punctuate`, `diarize`, `utterance`, `numerals`, and `language`.
54
+ # If `language` is provided both as a top-level parameter and in `model_config`,
55
+ # the top-level parameter takes precedence.
56
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
57
+ attr_reader :model_config
58
+
59
+ sig { params(model_config: T::Hash[Symbol, T.anything]).void }
60
+ attr_writer :model_config
61
+
39
62
  # The format of the transcript output. Use `verbose_json` to take advantage of
40
63
  # timestamps.
41
64
  sig do
@@ -80,6 +103,8 @@ module Telnyx
80
103
  model: Telnyx::AI::AudioTranscribeParams::Model::OrSymbol,
81
104
  file: Telnyx::Internal::FileInput,
82
105
  file_url: String,
106
+ language: String,
107
+ model_config: T::Hash[Symbol, T.anything],
83
108
  response_format:
84
109
  Telnyx::AI::AudioTranscribeParams::ResponseFormat::OrSymbol,
85
110
  timestamp_granularities:
@@ -90,16 +115,29 @@ module Telnyx
90
115
  def self.new(
91
116
  # ID of the model to use. `distil-whisper/distil-large-v2` is lower latency but
92
117
  # English-only. `openai/whisper-large-v3-turbo` is multi-lingual but slightly
93
- # higher latency.
118
+ # higher latency. `deepgram/nova-3` supports English variants (en, en-US, en-GB,
119
+ # en-AU, en-NZ, en-IN) and only accepts mp3/wav files.
94
120
  model:,
95
121
  # The audio file object to transcribe, in one of these formats: flac, mp3, mp4,
96
122
  # mpeg, mpga, m4a, ogg, wav, or webm. File uploads are limited to 100 MB. Cannot
97
- # be used together with `file_url`
123
+ # be used together with `file_url`. Note: `deepgram/nova-3` only supports mp3 and
124
+ # wav formats.
98
125
  file: nil,
99
126
  # Link to audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a,
100
127
  # ogg, wav, or webm. Support for hosted files is limited to 100MB. Cannot be used
101
- # together with `file`
128
+ # together with `file`. Note: `deepgram/nova-3` only supports mp3 and wav formats.
102
129
  file_url: nil,
130
+ # The language of the audio to be transcribed. For `deepgram/nova-3`, only English
131
+ # variants are supported: `en`, `en-US`, `en-GB`, `en-AU`, `en-NZ`, `en-IN`. For
132
+ # `openai/whisper-large-v3-turbo`, supports multiple languages.
133
+ # `distil-whisper/distil-large-v2` does not support language parameter.
134
+ language: nil,
135
+ # Additional model-specific configuration parameters. Only allowed with
136
+ # `deepgram/nova-3` model. Can include Deepgram-specific options such as
137
+ # `smart_format`, `punctuate`, `diarize`, `utterance`, `numerals`, and `language`.
138
+ # If `language` is provided both as a top-level parameter and in `model_config`,
139
+ # the top-level parameter takes precedence.
140
+ model_config: nil,
103
141
  # The format of the transcript output. Use `verbose_json` to take advantage of
104
142
  # timestamps.
105
143
  response_format: nil,
@@ -117,6 +155,8 @@ module Telnyx
117
155
  model: Telnyx::AI::AudioTranscribeParams::Model::OrSymbol,
118
156
  file: Telnyx::Internal::FileInput,
119
157
  file_url: String,
158
+ language: String,
159
+ model_config: T::Hash[Symbol, T.anything],
120
160
  response_format:
121
161
  Telnyx::AI::AudioTranscribeParams::ResponseFormat::OrSymbol,
122
162
  timestamp_granularities:
@@ -130,7 +170,8 @@ module Telnyx
130
170
 
131
171
  # ID of the model to use. `distil-whisper/distil-large-v2` is lower latency but
132
172
  # English-only. `openai/whisper-large-v3-turbo` is multi-lingual but slightly
133
- # higher latency.
173
+ # higher latency. `deepgram/nova-3` supports English variants (en, en-US, en-GB,
174
+ # en-AU, en-NZ, en-IN) and only accepts mp3/wav files.
134
175
  module Model
135
176
  extend Telnyx::Internal::Type::Enum
136
177
 
@@ -150,6 +191,11 @@ module Telnyx
150
191
  :"openai/whisper-large-v3-turbo",
151
192
  Telnyx::AI::AudioTranscribeParams::Model::TaggedSymbol
152
193
  )
194
+ DEEPGRAM_NOVA_3 =
195
+ T.let(
196
+ :"deepgram/nova-3",
197
+ Telnyx::AI::AudioTranscribeParams::Model::TaggedSymbol
198
+ )
153
199
 
154
200
  sig do
155
201
  override.returns(