telnyx 5.173.0 → 5.174.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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +0 -4
  5. data/lib/telnyx/lib/access_token.rb +141 -0
  6. data/lib/telnyx/lib/telephony_credentials.rb +87 -0
  7. data/lib/telnyx/lib.rb +2 -0
  8. data/lib/telnyx/models/ai/memory/namespaces/namespace_settings.rb +26 -0
  9. data/lib/telnyx/models/ai/memory/namespaces/namespace_settings_response.rb +3 -41
  10. data/lib/telnyx/models/ai/memory/namespaces/summary_settings.rb +33 -0
  11. data/lib/telnyx/models/ai/transcription_challenger.rb +148 -0
  12. data/lib/telnyx/models/ai/transcription_fallback_model.rb +78 -0
  13. data/lib/telnyx/models/ai/transcription_settings.rb +6 -219
  14. data/lib/telnyx/models/compute/funcs/func_log_export_config.rb +96 -0
  15. data/lib/telnyx/models/compute/funcs/func_log_export_config_response.rb +3 -89
  16. data/lib/telnyx/models/email_template_common.rb +5 -26
  17. data/lib/telnyx/models/email_template_create_params.rb +5 -26
  18. data/lib/telnyx/models/messaging_outbound_message_payload.rb +22 -1
  19. data/lib/telnyx/models/messaging_profile_features.rb +16 -1
  20. data/lib/telnyx/models/model_metadata.rb +10 -1
  21. data/lib/telnyx/models/outbound_message_payload.rb +22 -1
  22. data/lib/telnyx/models/phone_numbers/numbers_phone_numbers_job.rb +6 -50
  23. data/lib/telnyx/models/phone_numbers/phone_numbers_job.rb +6 -50
  24. data/lib/telnyx/models/phone_numbers/phone_numbers_job_pending_operation.rb +28 -0
  25. data/lib/telnyx/models/phone_numbers/phone_numbers_job_successful_operation.rb +28 -0
  26. data/lib/telnyx/models/update_email_template_request.rb +5 -26
  27. data/lib/telnyx/models/variable_schema_entry.rb +28 -0
  28. data/lib/telnyx/models/whatsapp/hosted_signup_create_response.rb +3 -83
  29. data/lib/telnyx/models/whatsapp/hosted_signup_retrieve_response.rb +3 -84
  30. data/lib/telnyx/models/whatsapp/phone_number_get_response.rb +3 -191
  31. data/lib/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rb +3 -192
  32. data/lib/telnyx/models/whatsapp/{hosted_signup_list_response.rb → whatsapp_hosted_signup.rb} +8 -6
  33. data/lib/telnyx/models/whatsapp/{phone_number_list_response.rb → whatsapp_phone_response.rb} +12 -12
  34. data/lib/telnyx/models.rb +2 -0
  35. data/lib/telnyx/resources/email_templates.rb +3 -3
  36. data/lib/telnyx/resources/portouts.rb +2 -1
  37. data/lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb +2 -2
  38. data/lib/telnyx/resources/whatsapp/hosted_signups.rb +2 -2
  39. data/lib/telnyx/resources/whatsapp/phone_numbers.rb +2 -2
  40. data/lib/telnyx/version.rb +1 -1
  41. data/lib/telnyx.rb +10 -5
  42. data/rbi/telnyx/client.rbi +0 -3
  43. data/rbi/telnyx/lib/access_token.rbi +73 -0
  44. data/rbi/telnyx/lib/telephony_credentials.rbi +50 -0
  45. data/rbi/telnyx/models/ai/memory/namespaces/namespace_settings.rbi +58 -0
  46. data/rbi/telnyx/models/ai/memory/namespaces/namespace_settings_response.rbi +4 -107
  47. data/rbi/telnyx/models/ai/memory/namespaces/summary_settings.rbi +51 -0
  48. data/rbi/telnyx/models/ai/transcription_challenger.rbi +318 -0
  49. data/rbi/telnyx/models/ai/transcription_fallback_model.rbi +171 -0
  50. data/rbi/telnyx/models/ai/transcription_settings.rbi +7 -531
  51. data/rbi/telnyx/models/compute/funcs/func_log_export_config.rbi +175 -0
  52. data/rbi/telnyx/models/compute/funcs/func_log_export_config_response.rbi +4 -176
  53. data/rbi/telnyx/models/email_template_common.rbi +3 -56
  54. data/rbi/telnyx/models/email_template_create_params.rbi +3 -59
  55. data/rbi/telnyx/models/messaging_outbound_message_payload.rbi +26 -0
  56. data/rbi/telnyx/models/messaging_profile_features.rbi +36 -5
  57. data/rbi/telnyx/models/model_metadata.rbi +13 -0
  58. data/rbi/telnyx/models/outbound_message_payload.rbi +26 -0
  59. data/rbi/telnyx/models/phone_numbers/numbers_phone_numbers_job.rbi +8 -96
  60. data/rbi/telnyx/models/phone_numbers/phone_numbers_job.rbi +8 -94
  61. data/rbi/telnyx/models/phone_numbers/phone_numbers_job_pending_operation.rbi +49 -0
  62. data/rbi/telnyx/models/phone_numbers/phone_numbers_job_successful_operation.rbi +49 -0
  63. data/rbi/telnyx/models/update_email_template_request.rbi +3 -59
  64. data/rbi/telnyx/models/variable_schema_entry.rbi +40 -0
  65. data/rbi/telnyx/models/whatsapp/hosted_signup_create_response.rbi +6 -173
  66. data/rbi/telnyx/models/whatsapp/hosted_signup_retrieve_response.rbi +6 -175
  67. data/rbi/telnyx/models/whatsapp/phone_number_get_response.rbi +4 -366
  68. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbi +6 -368
  69. data/rbi/telnyx/models/whatsapp/{hosted_signup_list_response.rbi → whatsapp_hosted_signup.rbi} +11 -12
  70. data/rbi/telnyx/models/whatsapp/{phone_number_list_response.rbi → whatsapp_phone_response.rbi} +23 -23
  71. data/rbi/telnyx/models.rbi +2 -0
  72. data/rbi/telnyx/resources/email_templates.rbi +3 -18
  73. data/rbi/telnyx/resources/portouts.rbi +2 -1
  74. data/rbi/telnyx/resources/whatsapp/business_accounts/phone_numbers.rbi +1 -1
  75. data/rbi/telnyx/resources/whatsapp/hosted_signups.rbi +1 -1
  76. data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +1 -1
  77. data/sig/telnyx/client.rbs +0 -2
  78. data/sig/telnyx/models/ai/memory/namespaces/namespace_settings.rbs +30 -0
  79. data/sig/telnyx/models/ai/memory/namespaces/namespace_settings_response.rbs +4 -37
  80. data/sig/telnyx/models/ai/memory/namespaces/summary_settings.rbs +19 -0
  81. data/sig/telnyx/models/ai/transcription_challenger.rbs +98 -0
  82. data/sig/telnyx/models/ai/transcription_fallback_model.rbs +63 -0
  83. data/sig/telnyx/models/ai/transcription_settings.rbs +8 -159
  84. data/sig/telnyx/models/compute/funcs/func_log_export_config.rbs +96 -0
  85. data/sig/telnyx/models/compute/funcs/func_log_export_config_response.rbs +6 -95
  86. data/sig/telnyx/models/email_template_common.rbs +4 -18
  87. data/sig/telnyx/models/email_template_create_params.rbs +4 -18
  88. data/sig/telnyx/models/messaging_outbound_message_payload.rbs +10 -0
  89. data/sig/telnyx/models/messaging_profile_features.rbs +14 -3
  90. data/sig/telnyx/models/model_metadata.rbs +7 -0
  91. data/sig/telnyx/models/outbound_message_payload.rbs +10 -0
  92. data/sig/telnyx/models/phone_numbers/numbers_phone_numbers_job.rbs +12 -44
  93. data/sig/telnyx/models/phone_numbers/phone_numbers_job.rbs +12 -44
  94. data/sig/telnyx/models/phone_numbers/phone_numbers_job_pending_operation.rbs +24 -0
  95. data/sig/telnyx/models/phone_numbers/phone_numbers_job_successful_operation.rbs +24 -0
  96. data/sig/telnyx/models/update_email_template_request.rbs +4 -18
  97. data/sig/telnyx/models/variable_schema_entry.rbs +17 -0
  98. data/sig/telnyx/models/whatsapp/hosted_signup_create_response.rbs +6 -90
  99. data/sig/telnyx/models/whatsapp/hosted_signup_retrieve_response.rbs +6 -90
  100. data/sig/telnyx/models/whatsapp/phone_number_get_response.rbs +6 -185
  101. data/sig/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbs +4 -189
  102. data/sig/telnyx/models/whatsapp/{hosted_signup_list_response.rbs → whatsapp_hosted_signup.rbs} +11 -9
  103. data/sig/telnyx/models/whatsapp/{phone_number_list_response.rbs → whatsapp_phone_response.rbs} +13 -11
  104. data/sig/telnyx/models.rbs +2 -0
  105. data/sig/telnyx/resources/email_templates.rbs +3 -3
  106. data/sig/telnyx/resources/whatsapp/business_accounts/phone_numbers.rbs +1 -1
  107. data/sig/telnyx/resources/whatsapp/hosted_signups.rbs +1 -1
  108. data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +1 -1
  109. metadata +36 -17
  110. data/lib/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rb +0 -198
  111. data/lib/telnyx/resources/tts_integrations/actions.rb +0 -16
  112. data/lib/telnyx/resources/tts_integrations.rb +0 -18
  113. data/rbi/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbi +0 -358
  114. data/rbi/telnyx/resources/tts_integrations/actions.rbi +0 -14
  115. data/rbi/telnyx/resources/tts_integrations.rbi +0 -15
  116. data/sig/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbs +0 -186
  117. data/sig/telnyx/resources/tts_integrations/actions.rbs +0 -9
  118. data/sig/telnyx/resources/tts_integrations.rbs +0 -9
@@ -0,0 +1,318 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ class TranscriptionChallenger < Telnyx::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Telnyx::AI::TranscriptionChallenger,
11
+ Telnyx::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The language booster's model. It must be the same kind of model as
16
+ # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
17
+ # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
18
+ # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
19
+ # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
20
+ # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
21
+ # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
22
+ # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
23
+ # `transcription.model` on a different `language`.
24
+ sig { returns(Telnyx::AI::TranscriptionChallenger::Model::OrSymbol) }
25
+ attr_accessor :model
26
+
27
+ # The language this model transcribes. Omit it or set it to `null` to use the
28
+ # language of `transcription.model`. The request is rejected when this model
29
+ # doesn't support the language it would run. It is also rejected when it would run
30
+ # the same model on the same language as `transcription.model`.
31
+ sig { returns(T.nilable(String)) }
32
+ attr_accessor :language
33
+
34
+ # How the assistant picks the transcript it uses. The models are compared on how
35
+ # complete and confident their transcripts are, not on language, so the rules work
36
+ # best when both models understand the callers' language.
37
+ #
38
+ # - `best_turn` (default): both models transcribe the whole call. Each turn uses
39
+ # the language booster's transcript only when it scores higher than the
40
+ # transcript of `transcription.model` (clearly higher with non-streaming
41
+ # models). With streaming models, `transcription.model` also decides when each
42
+ # turn ends. Available for every pair.
43
+ # - `best_engine`: both models transcribe the first turns, then the call continues
44
+ # alone on the model whose transcripts scored higher. If neither clearly leads,
45
+ # `transcription.model` continues. Streaming models only.
46
+ # - `merge_words`: both models transcribe each utterance and their words are
47
+ # merged, keeping Arabic and English spoken in the same sentence. Available only
48
+ # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
49
+ # the language that applies to `telnyx/basira` (its own, or that of
50
+ # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
51
+ # `multi`, or `auto`.
52
+ sig do
53
+ returns(
54
+ T.nilable(Telnyx::AI::TranscriptionChallenger::Rule::OrSymbol)
55
+ )
56
+ end
57
+ attr_reader :rule
58
+
59
+ sig do
60
+ params(rule: Telnyx::AI::TranscriptionChallenger::Rule::OrSymbol).void
61
+ end
62
+ attr_writer :rule
63
+
64
+ # Settings for the language booster, with the same fields and limits as
65
+ # `transcription.settings`. Fields that don't apply to this model's provider are
66
+ # dropped, and the provider's defaults fill in the rest. Omit it or set it to
67
+ # `null` to use the settings of `transcription.model` where they apply to this
68
+ # model.
69
+ sig { returns(T.nilable(Telnyx::AI::TranscriptionSettingsConfig)) }
70
+ attr_reader :settings
71
+
72
+ sig do
73
+ params(
74
+ settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
75
+ ).void
76
+ end
77
+ attr_writer :settings
78
+
79
+ # A second speech-to-text model that transcribes alongside `transcription.model`,
80
+ # and the rule that decides which transcript the assistant uses.
81
+ sig do
82
+ params(
83
+ model: Telnyx::AI::TranscriptionChallenger::Model::OrSymbol,
84
+ language: T.nilable(String),
85
+ rule: Telnyx::AI::TranscriptionChallenger::Rule::OrSymbol,
86
+ settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
87
+ ).returns(T.attached_class)
88
+ end
89
+ def self.new(
90
+ # The language booster's model. It must be the same kind of model as
91
+ # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
92
+ # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
93
+ # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
94
+ # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
95
+ # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
96
+ # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
97
+ # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
98
+ # `transcription.model` on a different `language`.
99
+ model:,
100
+ # The language this model transcribes. Omit it or set it to `null` to use the
101
+ # language of `transcription.model`. The request is rejected when this model
102
+ # doesn't support the language it would run. It is also rejected when it would run
103
+ # the same model on the same language as `transcription.model`.
104
+ language: nil,
105
+ # How the assistant picks the transcript it uses. The models are compared on how
106
+ # complete and confident their transcripts are, not on language, so the rules work
107
+ # best when both models understand the callers' language.
108
+ #
109
+ # - `best_turn` (default): both models transcribe the whole call. Each turn uses
110
+ # the language booster's transcript only when it scores higher than the
111
+ # transcript of `transcription.model` (clearly higher with non-streaming
112
+ # models). With streaming models, `transcription.model` also decides when each
113
+ # turn ends. Available for every pair.
114
+ # - `best_engine`: both models transcribe the first turns, then the call continues
115
+ # alone on the model whose transcripts scored higher. If neither clearly leads,
116
+ # `transcription.model` continues. Streaming models only.
117
+ # - `merge_words`: both models transcribe each utterance and their words are
118
+ # merged, keeping Arabic and English spoken in the same sentence. Available only
119
+ # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
120
+ # the language that applies to `telnyx/basira` (its own, or that of
121
+ # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
122
+ # `multi`, or `auto`.
123
+ rule: nil,
124
+ # Settings for the language booster, with the same fields and limits as
125
+ # `transcription.settings`. Fields that don't apply to this model's provider are
126
+ # dropped, and the provider's defaults fill in the rest. Omit it or set it to
127
+ # `null` to use the settings of `transcription.model` where they apply to this
128
+ # model.
129
+ settings: nil
130
+ )
131
+ end
132
+
133
+ sig do
134
+ override.returns(
135
+ {
136
+ model: Telnyx::AI::TranscriptionChallenger::Model::OrSymbol,
137
+ language: T.nilable(String),
138
+ rule: Telnyx::AI::TranscriptionChallenger::Rule::OrSymbol,
139
+ settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig)
140
+ }
141
+ )
142
+ end
143
+ def to_hash
144
+ end
145
+
146
+ # The language booster's model. It must be the same kind of model as
147
+ # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
148
+ # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
149
+ # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
150
+ # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
151
+ # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
152
+ # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
153
+ # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
154
+ # `transcription.model` on a different `language`.
155
+ module Model
156
+ extend Telnyx::Internal::Type::Enum
157
+
158
+ TaggedSymbol =
159
+ T.type_alias do
160
+ T.all(Symbol, Telnyx::AI::TranscriptionChallenger::Model)
161
+ end
162
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
163
+
164
+ DEEPGRAM_FLUX =
165
+ T.let(
166
+ :"deepgram/flux",
167
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
168
+ )
169
+ DEEPGRAM_NOVA_3 =
170
+ T.let(
171
+ :"deepgram/nova-3",
172
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
173
+ )
174
+ DEEPGRAM_NOVA_2 =
175
+ T.let(
176
+ :"deepgram/nova-2",
177
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
178
+ )
179
+ AZURE_FAST =
180
+ T.let(
181
+ :"azure/fast",
182
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
183
+ )
184
+ ASSEMBLYAI_UNIVERSAL_3_6_PRO =
185
+ T.let(
186
+ :"assemblyai/universal-3-6-pro",
187
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
188
+ )
189
+ ASSEMBLYAI_UNIVERSAL_3_5_PRO =
190
+ T.let(
191
+ :"assemblyai/universal-3-5-pro",
192
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
193
+ )
194
+ ASSEMBLYAI_UNIVERSAL_STREAMING =
195
+ T.let(
196
+ :"assemblyai/universal-streaming",
197
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
198
+ )
199
+ XAI_GROK_STT =
200
+ T.let(
201
+ :"xai/grok-stt",
202
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
203
+ )
204
+ SONIOX_STT_RT_V4 =
205
+ T.let(
206
+ :"soniox/stt-rt-v4",
207
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
208
+ )
209
+ SONIOX_STT_RT_V5 =
210
+ T.let(
211
+ :"soniox/stt-rt-v5",
212
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
213
+ )
214
+ NVIDIA_PARAKEET_V3 =
215
+ T.let(
216
+ :"nvidia/parakeet-v3",
217
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
218
+ )
219
+ OMI_HEALTH_OMI_MED_STT_V1 =
220
+ T.let(
221
+ :"omi-health/omi-med-stt-v1",
222
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
223
+ )
224
+ HUMAIN_REALTIME =
225
+ T.let(
226
+ :"humain/realtime",
227
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
228
+ )
229
+ RESON8_TURNS =
230
+ T.let(
231
+ :"reson8/turns",
232
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
233
+ )
234
+ COHERE_AR_STT =
235
+ T.let(
236
+ :"cohere/ar-stt",
237
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
238
+ )
239
+ TELNYX_BASIRA =
240
+ T.let(
241
+ :"telnyx/basira",
242
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
243
+ )
244
+ DISTIL_WHISPER_DISTIL_LARGE_V2 =
245
+ T.let(
246
+ :"distil-whisper/distil-large-v2",
247
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
248
+ )
249
+ OPENAI_WHISPER_LARGE_V3_TURBO =
250
+ T.let(
251
+ :"openai/whisper-large-v3-turbo",
252
+ Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol
253
+ )
254
+
255
+ sig do
256
+ override.returns(
257
+ T::Array[Telnyx::AI::TranscriptionChallenger::Model::TaggedSymbol]
258
+ )
259
+ end
260
+ def self.values
261
+ end
262
+ end
263
+
264
+ # How the assistant picks the transcript it uses. The models are compared on how
265
+ # complete and confident their transcripts are, not on language, so the rules work
266
+ # best when both models understand the callers' language.
267
+ #
268
+ # - `best_turn` (default): both models transcribe the whole call. Each turn uses
269
+ # the language booster's transcript only when it scores higher than the
270
+ # transcript of `transcription.model` (clearly higher with non-streaming
271
+ # models). With streaming models, `transcription.model` also decides when each
272
+ # turn ends. Available for every pair.
273
+ # - `best_engine`: both models transcribe the first turns, then the call continues
274
+ # alone on the model whose transcripts scored higher. If neither clearly leads,
275
+ # `transcription.model` continues. Streaming models only.
276
+ # - `merge_words`: both models transcribe each utterance and their words are
277
+ # merged, keeping Arabic and English spoken in the same sentence. Available only
278
+ # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
279
+ # the language that applies to `telnyx/basira` (its own, or that of
280
+ # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
281
+ # `multi`, or `auto`.
282
+ module Rule
283
+ extend Telnyx::Internal::Type::Enum
284
+
285
+ TaggedSymbol =
286
+ T.type_alias do
287
+ T.all(Symbol, Telnyx::AI::TranscriptionChallenger::Rule)
288
+ end
289
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
290
+
291
+ BEST_TURN =
292
+ T.let(
293
+ :best_turn,
294
+ Telnyx::AI::TranscriptionChallenger::Rule::TaggedSymbol
295
+ )
296
+ BEST_ENGINE =
297
+ T.let(
298
+ :best_engine,
299
+ Telnyx::AI::TranscriptionChallenger::Rule::TaggedSymbol
300
+ )
301
+ MERGE_WORDS =
302
+ T.let(
303
+ :merge_words,
304
+ Telnyx::AI::TranscriptionChallenger::Rule::TaggedSymbol
305
+ )
306
+
307
+ sig do
308
+ override.returns(
309
+ T::Array[Telnyx::AI::TranscriptionChallenger::Rule::TaggedSymbol]
310
+ )
311
+ end
312
+ def self.values
313
+ end
314
+ end
315
+ end
316
+ end
317
+ end
318
+ end
@@ -0,0 +1,171 @@
1
+ # typed: strong
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ class TranscriptionFallbackModel < Telnyx::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Telnyx::AI::TranscriptionFallbackModel,
11
+ Telnyx::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The fallback model. It must be a streaming model other than
16
+ # `transcription.model` and the other fallbacks: `deepgram/flux`,
17
+ # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
18
+ # legacy aliases `assemblyai/universal-3-5-pro` and
19
+ # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
20
+ # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
21
+ sig { returns(Telnyx::AI::TranscriptionFallbackModel::Model::OrSymbol) }
22
+ attr_accessor :model
23
+
24
+ # The language the fallback transcribes. Omit it or set it to `null` to use the
25
+ # language of `transcription.model`. The request is rejected when the fallback
26
+ # model doesn't support the language it would run.
27
+ sig { returns(T.nilable(String)) }
28
+ attr_accessor :language
29
+
30
+ # Settings for the fallback, with the same fields and limits as
31
+ # `transcription.settings`. Fields that don't apply to this model's provider are
32
+ # dropped, and the provider's defaults fill in the rest. Omit it or set it to
33
+ # `null` to use the settings of `transcription.model` where they apply to this
34
+ # model.
35
+ sig { returns(T.nilable(Telnyx::AI::TranscriptionSettingsConfig)) }
36
+ attr_reader :settings
37
+
38
+ sig do
39
+ params(
40
+ settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
41
+ ).void
42
+ end
43
+ attr_writer :settings
44
+
45
+ # A streaming speech-to-text model that takes over transcription when the model in
46
+ # use fails.
47
+ sig do
48
+ params(
49
+ model: Telnyx::AI::TranscriptionFallbackModel::Model::OrSymbol,
50
+ language: T.nilable(String),
51
+ settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
52
+ ).returns(T.attached_class)
53
+ end
54
+ def self.new(
55
+ # The fallback model. It must be a streaming model other than
56
+ # `transcription.model` and the other fallbacks: `deepgram/flux`,
57
+ # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
58
+ # legacy aliases `assemblyai/universal-3-5-pro` and
59
+ # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
60
+ # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
61
+ model:,
62
+ # The language the fallback transcribes. Omit it or set it to `null` to use the
63
+ # language of `transcription.model`. The request is rejected when the fallback
64
+ # model doesn't support the language it would run.
65
+ language: nil,
66
+ # Settings for the fallback, with the same fields and limits as
67
+ # `transcription.settings`. Fields that don't apply to this model's provider are
68
+ # dropped, and the provider's defaults fill in the rest. Omit it or set it to
69
+ # `null` to use the settings of `transcription.model` where they apply to this
70
+ # model.
71
+ settings: nil
72
+ )
73
+ end
74
+
75
+ sig do
76
+ override.returns(
77
+ {
78
+ model: Telnyx::AI::TranscriptionFallbackModel::Model::OrSymbol,
79
+ language: T.nilable(String),
80
+ settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig)
81
+ }
82
+ )
83
+ end
84
+ def to_hash
85
+ end
86
+
87
+ # The fallback model. It must be a streaming model other than
88
+ # `transcription.model` and the other fallbacks: `deepgram/flux`,
89
+ # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
90
+ # legacy aliases `assemblyai/universal-3-5-pro` and
91
+ # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
92
+ # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
93
+ module Model
94
+ extend Telnyx::Internal::Type::Enum
95
+
96
+ TaggedSymbol =
97
+ T.type_alias do
98
+ T.all(Symbol, Telnyx::AI::TranscriptionFallbackModel::Model)
99
+ end
100
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
101
+
102
+ DEEPGRAM_FLUX =
103
+ T.let(
104
+ :"deepgram/flux",
105
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
106
+ )
107
+ DEEPGRAM_NOVA_3 =
108
+ T.let(
109
+ :"deepgram/nova-3",
110
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
111
+ )
112
+ DEEPGRAM_NOVA_2 =
113
+ T.let(
114
+ :"deepgram/nova-2",
115
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
116
+ )
117
+ ASSEMBLYAI_UNIVERSAL_3_6_PRO =
118
+ T.let(
119
+ :"assemblyai/universal-3-6-pro",
120
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
121
+ )
122
+ ASSEMBLYAI_UNIVERSAL_3_5_PRO =
123
+ T.let(
124
+ :"assemblyai/universal-3-5-pro",
125
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
126
+ )
127
+ ASSEMBLYAI_UNIVERSAL_STREAMING =
128
+ T.let(
129
+ :"assemblyai/universal-streaming",
130
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
131
+ )
132
+ XAI_GROK_STT =
133
+ T.let(
134
+ :"xai/grok-stt",
135
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
136
+ )
137
+ SONIOX_STT_RT_V4 =
138
+ T.let(
139
+ :"soniox/stt-rt-v4",
140
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
141
+ )
142
+ SONIOX_STT_RT_V5 =
143
+ T.let(
144
+ :"soniox/stt-rt-v5",
145
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
146
+ )
147
+ HUMAIN_REALTIME =
148
+ T.let(
149
+ :"humain/realtime",
150
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
151
+ )
152
+ RESON8_TURNS =
153
+ T.let(
154
+ :"reson8/turns",
155
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
156
+ )
157
+
158
+ sig do
159
+ override.returns(
160
+ T::Array[
161
+ Telnyx::AI::TranscriptionFallbackModel::Model::TaggedSymbol
162
+ ]
163
+ )
164
+ end
165
+ def self.values
166
+ end
167
+ end
168
+ end
169
+ end
170
+ end
171
+ end