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
@@ -19,15 +19,12 @@ module Telnyx
19
19
 
20
20
  # A second speech-to-text model that transcribes alongside `transcription.model`,
21
21
  # and the rule that decides which transcript the assistant uses.
22
- sig do
23
- returns(T.nilable(Telnyx::AI::TranscriptionSettings::Challenger))
24
- end
22
+ sig { returns(T.nilable(Telnyx::AI::TranscriptionChallenger)) }
25
23
  attr_reader :challenger
26
24
 
27
25
  sig do
28
26
  params(
29
- challenger:
30
- T.nilable(Telnyx::AI::TranscriptionSettings::Challenger::OrHash)
27
+ challenger: T.nilable(Telnyx::AI::TranscriptionChallenger::OrHash)
31
28
  ).void
32
29
  end
33
30
  attr_writer :challenger
@@ -41,11 +38,7 @@ module Telnyx
41
38
  # Can't be combined with `challenger`, the language booster; to replace a stored
42
39
  # language booster, send `challenger: null` in the same request.
43
40
  sig do
44
- returns(
45
- T.nilable(
46
- T::Array[Telnyx::AI::TranscriptionSettings::FallbackModel]
47
- )
48
- )
41
+ returns(T.nilable(T::Array[Telnyx::AI::TranscriptionFallbackModel]))
49
42
  end
50
43
  attr_accessor :fallback_models
51
44
 
@@ -137,13 +130,10 @@ module Telnyx
137
130
  sig do
138
131
  params(
139
132
  api_key_ref: String,
140
- challenger:
141
- T.nilable(Telnyx::AI::TranscriptionSettings::Challenger::OrHash),
133
+ challenger: T.nilable(Telnyx::AI::TranscriptionChallenger::OrHash),
142
134
  fallback_models:
143
135
  T.nilable(
144
- T::Array[
145
- Telnyx::AI::TranscriptionSettings::FallbackModel::OrHash
146
- ]
136
+ T::Array[Telnyx::AI::TranscriptionFallbackModel::OrHash]
147
137
  ),
148
138
  language: String,
149
139
  model: Telnyx::AI::TranscriptionSettings::Model::OrSymbol,
@@ -233,12 +223,9 @@ module Telnyx
233
223
  override.returns(
234
224
  {
235
225
  api_key_ref: String,
236
- challenger:
237
- T.nilable(Telnyx::AI::TranscriptionSettings::Challenger),
226
+ challenger: T.nilable(Telnyx::AI::TranscriptionChallenger),
238
227
  fallback_models:
239
- T.nilable(
240
- T::Array[Telnyx::AI::TranscriptionSettings::FallbackModel]
241
- ),
228
+ T.nilable(T::Array[Telnyx::AI::TranscriptionFallbackModel]),
242
229
  language: String,
243
230
  model: Telnyx::AI::TranscriptionSettings::Model::OrSymbol,
244
231
  region: String,
@@ -249,517 +236,6 @@ module Telnyx
249
236
  def to_hash
250
237
  end
251
238
 
252
- class Challenger < Telnyx::Internal::Type::BaseModel
253
- OrHash =
254
- T.type_alias do
255
- T.any(
256
- Telnyx::AI::TranscriptionSettings::Challenger,
257
- Telnyx::Internal::AnyHash
258
- )
259
- end
260
-
261
- # The language booster's model. It must be the same kind of model as
262
- # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
263
- # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
264
- # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
265
- # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
266
- # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
267
- # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
268
- # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
269
- # `transcription.model` on a different `language`.
270
- sig do
271
- returns(
272
- Telnyx::AI::TranscriptionSettings::Challenger::Model::OrSymbol
273
- )
274
- end
275
- attr_accessor :model
276
-
277
- # The language this model transcribes. Omit it or set it to `null` to use the
278
- # language of `transcription.model`. The request is rejected when this model
279
- # doesn't support the language it would run. It is also rejected when it would run
280
- # the same model on the same language as `transcription.model`.
281
- sig { returns(T.nilable(String)) }
282
- attr_accessor :language
283
-
284
- # How the assistant picks the transcript it uses. The models are compared on how
285
- # complete and confident their transcripts are, not on language, so the rules work
286
- # best when both models understand the callers' language.
287
- #
288
- # - `best_turn` (default): both models transcribe the whole call. Each turn uses
289
- # the language booster's transcript only when it scores higher than the
290
- # transcript of `transcription.model` (clearly higher with non-streaming
291
- # models). With streaming models, `transcription.model` also decides when each
292
- # turn ends. Available for every pair.
293
- # - `best_engine`: both models transcribe the first turns, then the call continues
294
- # alone on the model whose transcripts scored higher. If neither clearly leads,
295
- # `transcription.model` continues. Streaming models only.
296
- # - `merge_words`: both models transcribe each utterance and their words are
297
- # merged, keeping Arabic and English spoken in the same sentence. Available only
298
- # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
299
- # the language that applies to `telnyx/basira` (its own, or that of
300
- # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
301
- # `multi`, or `auto`.
302
- sig do
303
- returns(
304
- T.nilable(
305
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::OrSymbol
306
- )
307
- )
308
- end
309
- attr_reader :rule
310
-
311
- sig do
312
- params(
313
- rule:
314
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::OrSymbol
315
- ).void
316
- end
317
- attr_writer :rule
318
-
319
- # Settings for the language booster, with the same fields and limits as
320
- # `transcription.settings`. Fields that don't apply to this model's provider are
321
- # dropped, and the provider's defaults fill in the rest. Omit it or set it to
322
- # `null` to use the settings of `transcription.model` where they apply to this
323
- # model.
324
- sig { returns(T.nilable(Telnyx::AI::TranscriptionSettingsConfig)) }
325
- attr_reader :settings
326
-
327
- sig do
328
- params(
329
- settings:
330
- T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
331
- ).void
332
- end
333
- attr_writer :settings
334
-
335
- # A second speech-to-text model that transcribes alongside `transcription.model`,
336
- # and the rule that decides which transcript the assistant uses.
337
- sig do
338
- params(
339
- model:
340
- Telnyx::AI::TranscriptionSettings::Challenger::Model::OrSymbol,
341
- language: T.nilable(String),
342
- rule:
343
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::OrSymbol,
344
- settings:
345
- T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
346
- ).returns(T.attached_class)
347
- end
348
- def self.new(
349
- # The language booster's model. It must be the same kind of model as
350
- # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
351
- # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
352
- # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
353
- # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
354
- # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
355
- # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
356
- # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
357
- # `transcription.model` on a different `language`.
358
- model:,
359
- # The language this model transcribes. Omit it or set it to `null` to use the
360
- # language of `transcription.model`. The request is rejected when this model
361
- # doesn't support the language it would run. It is also rejected when it would run
362
- # the same model on the same language as `transcription.model`.
363
- language: nil,
364
- # How the assistant picks the transcript it uses. The models are compared on how
365
- # complete and confident their transcripts are, not on language, so the rules work
366
- # best when both models understand the callers' language.
367
- #
368
- # - `best_turn` (default): both models transcribe the whole call. Each turn uses
369
- # the language booster's transcript only when it scores higher than the
370
- # transcript of `transcription.model` (clearly higher with non-streaming
371
- # models). With streaming models, `transcription.model` also decides when each
372
- # turn ends. Available for every pair.
373
- # - `best_engine`: both models transcribe the first turns, then the call continues
374
- # alone on the model whose transcripts scored higher. If neither clearly leads,
375
- # `transcription.model` continues. Streaming models only.
376
- # - `merge_words`: both models transcribe each utterance and their words are
377
- # merged, keeping Arabic and English spoken in the same sentence. Available only
378
- # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
379
- # the language that applies to `telnyx/basira` (its own, or that of
380
- # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
381
- # `multi`, or `auto`.
382
- rule: nil,
383
- # Settings for the language booster, with the same fields and limits as
384
- # `transcription.settings`. Fields that don't apply to this model's provider are
385
- # dropped, and the provider's defaults fill in the rest. Omit it or set it to
386
- # `null` to use the settings of `transcription.model` where they apply to this
387
- # model.
388
- settings: nil
389
- )
390
- end
391
-
392
- sig do
393
- override.returns(
394
- {
395
- model:
396
- Telnyx::AI::TranscriptionSettings::Challenger::Model::OrSymbol,
397
- language: T.nilable(String),
398
- rule:
399
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::OrSymbol,
400
- settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig)
401
- }
402
- )
403
- end
404
- def to_hash
405
- end
406
-
407
- # The language booster's model. It must be the same kind of model as
408
- # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
409
- # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
410
- # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
411
- # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
412
- # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
413
- # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
414
- # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
415
- # `transcription.model` on a different `language`.
416
- module Model
417
- extend Telnyx::Internal::Type::Enum
418
-
419
- TaggedSymbol =
420
- T.type_alias do
421
- T.all(
422
- Symbol,
423
- Telnyx::AI::TranscriptionSettings::Challenger::Model
424
- )
425
- end
426
- OrSymbol = T.type_alias { T.any(Symbol, String) }
427
-
428
- DEEPGRAM_FLUX =
429
- T.let(
430
- :"deepgram/flux",
431
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
432
- )
433
- DEEPGRAM_NOVA_3 =
434
- T.let(
435
- :"deepgram/nova-3",
436
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
437
- )
438
- DEEPGRAM_NOVA_2 =
439
- T.let(
440
- :"deepgram/nova-2",
441
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
442
- )
443
- AZURE_FAST =
444
- T.let(
445
- :"azure/fast",
446
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
447
- )
448
- ASSEMBLYAI_UNIVERSAL_3_6_PRO =
449
- T.let(
450
- :"assemblyai/universal-3-6-pro",
451
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
452
- )
453
- ASSEMBLYAI_UNIVERSAL_3_5_PRO =
454
- T.let(
455
- :"assemblyai/universal-3-5-pro",
456
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
457
- )
458
- ASSEMBLYAI_UNIVERSAL_STREAMING =
459
- T.let(
460
- :"assemblyai/universal-streaming",
461
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
462
- )
463
- XAI_GROK_STT =
464
- T.let(
465
- :"xai/grok-stt",
466
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
467
- )
468
- SONIOX_STT_RT_V4 =
469
- T.let(
470
- :"soniox/stt-rt-v4",
471
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
472
- )
473
- SONIOX_STT_RT_V5 =
474
- T.let(
475
- :"soniox/stt-rt-v5",
476
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
477
- )
478
- NVIDIA_PARAKEET_V3 =
479
- T.let(
480
- :"nvidia/parakeet-v3",
481
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
482
- )
483
- OMI_HEALTH_OMI_MED_STT_V1 =
484
- T.let(
485
- :"omi-health/omi-med-stt-v1",
486
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
487
- )
488
- HUMAIN_REALTIME =
489
- T.let(
490
- :"humain/realtime",
491
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
492
- )
493
- RESON8_TURNS =
494
- T.let(
495
- :"reson8/turns",
496
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
497
- )
498
- COHERE_AR_STT =
499
- T.let(
500
- :"cohere/ar-stt",
501
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
502
- )
503
- TELNYX_BASIRA =
504
- T.let(
505
- :"telnyx/basira",
506
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
507
- )
508
- DISTIL_WHISPER_DISTIL_LARGE_V2 =
509
- T.let(
510
- :"distil-whisper/distil-large-v2",
511
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
512
- )
513
- OPENAI_WHISPER_LARGE_V3_TURBO =
514
- T.let(
515
- :"openai/whisper-large-v3-turbo",
516
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
517
- )
518
-
519
- sig do
520
- override.returns(
521
- T::Array[
522
- Telnyx::AI::TranscriptionSettings::Challenger::Model::TaggedSymbol
523
- ]
524
- )
525
- end
526
- def self.values
527
- end
528
- end
529
-
530
- # How the assistant picks the transcript it uses. The models are compared on how
531
- # complete and confident their transcripts are, not on language, so the rules work
532
- # best when both models understand the callers' language.
533
- #
534
- # - `best_turn` (default): both models transcribe the whole call. Each turn uses
535
- # the language booster's transcript only when it scores higher than the
536
- # transcript of `transcription.model` (clearly higher with non-streaming
537
- # models). With streaming models, `transcription.model` also decides when each
538
- # turn ends. Available for every pair.
539
- # - `best_engine`: both models transcribe the first turns, then the call continues
540
- # alone on the model whose transcripts scored higher. If neither clearly leads,
541
- # `transcription.model` continues. Streaming models only.
542
- # - `merge_words`: both models transcribe each utterance and their words are
543
- # merged, keeping Arabic and English spoken in the same sentence. Available only
544
- # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
545
- # the language that applies to `telnyx/basira` (its own, or that of
546
- # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
547
- # `multi`, or `auto`.
548
- module Rule
549
- extend Telnyx::Internal::Type::Enum
550
-
551
- TaggedSymbol =
552
- T.type_alias do
553
- T.all(
554
- Symbol,
555
- Telnyx::AI::TranscriptionSettings::Challenger::Rule
556
- )
557
- end
558
- OrSymbol = T.type_alias { T.any(Symbol, String) }
559
-
560
- BEST_TURN =
561
- T.let(
562
- :best_turn,
563
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::TaggedSymbol
564
- )
565
- BEST_ENGINE =
566
- T.let(
567
- :best_engine,
568
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::TaggedSymbol
569
- )
570
- MERGE_WORDS =
571
- T.let(
572
- :merge_words,
573
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::TaggedSymbol
574
- )
575
-
576
- sig do
577
- override.returns(
578
- T::Array[
579
- Telnyx::AI::TranscriptionSettings::Challenger::Rule::TaggedSymbol
580
- ]
581
- )
582
- end
583
- def self.values
584
- end
585
- end
586
- end
587
-
588
- class FallbackModel < Telnyx::Internal::Type::BaseModel
589
- OrHash =
590
- T.type_alias do
591
- T.any(
592
- Telnyx::AI::TranscriptionSettings::FallbackModel,
593
- Telnyx::Internal::AnyHash
594
- )
595
- end
596
-
597
- # The fallback model. It must be a streaming model other than
598
- # `transcription.model` and the other fallbacks: `deepgram/flux`,
599
- # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
600
- # legacy aliases `assemblyai/universal-3-5-pro` and
601
- # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
602
- # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
603
- sig do
604
- returns(
605
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::OrSymbol
606
- )
607
- end
608
- attr_accessor :model
609
-
610
- # The language the fallback transcribes. Omit it or set it to `null` to use the
611
- # language of `transcription.model`. The request is rejected when the fallback
612
- # model doesn't support the language it would run.
613
- sig { returns(T.nilable(String)) }
614
- attr_accessor :language
615
-
616
- # Settings for the fallback, with the same fields and limits as
617
- # `transcription.settings`. Fields that don't apply to this model's provider are
618
- # dropped, and the provider's defaults fill in the rest. Omit it or set it to
619
- # `null` to use the settings of `transcription.model` where they apply to this
620
- # model.
621
- sig { returns(T.nilable(Telnyx::AI::TranscriptionSettingsConfig)) }
622
- attr_reader :settings
623
-
624
- sig do
625
- params(
626
- settings:
627
- T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
628
- ).void
629
- end
630
- attr_writer :settings
631
-
632
- # A streaming speech-to-text model that takes over transcription when the model in
633
- # use fails.
634
- sig do
635
- params(
636
- model:
637
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::OrSymbol,
638
- language: T.nilable(String),
639
- settings:
640
- T.nilable(Telnyx::AI::TranscriptionSettingsConfig::OrHash)
641
- ).returns(T.attached_class)
642
- end
643
- def self.new(
644
- # The fallback model. It must be a streaming model other than
645
- # `transcription.model` and the other fallbacks: `deepgram/flux`,
646
- # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
647
- # legacy aliases `assemblyai/universal-3-5-pro` and
648
- # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
649
- # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
650
- model:,
651
- # The language the fallback transcribes. Omit it or set it to `null` to use the
652
- # language of `transcription.model`. The request is rejected when the fallback
653
- # model doesn't support the language it would run.
654
- language: nil,
655
- # Settings for the fallback, with the same fields and limits as
656
- # `transcription.settings`. Fields that don't apply to this model's provider are
657
- # dropped, and the provider's defaults fill in the rest. Omit it or set it to
658
- # `null` to use the settings of `transcription.model` where they apply to this
659
- # model.
660
- settings: nil
661
- )
662
- end
663
-
664
- sig do
665
- override.returns(
666
- {
667
- model:
668
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::OrSymbol,
669
- language: T.nilable(String),
670
- settings: T.nilable(Telnyx::AI::TranscriptionSettingsConfig)
671
- }
672
- )
673
- end
674
- def to_hash
675
- end
676
-
677
- # The fallback model. It must be a streaming model other than
678
- # `transcription.model` and the other fallbacks: `deepgram/flux`,
679
- # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
680
- # legacy aliases `assemblyai/universal-3-5-pro` and
681
- # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
682
- # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
683
- module Model
684
- extend Telnyx::Internal::Type::Enum
685
-
686
- TaggedSymbol =
687
- T.type_alias do
688
- T.all(
689
- Symbol,
690
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model
691
- )
692
- end
693
- OrSymbol = T.type_alias { T.any(Symbol, String) }
694
-
695
- DEEPGRAM_FLUX =
696
- T.let(
697
- :"deepgram/flux",
698
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
699
- )
700
- DEEPGRAM_NOVA_3 =
701
- T.let(
702
- :"deepgram/nova-3",
703
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
704
- )
705
- DEEPGRAM_NOVA_2 =
706
- T.let(
707
- :"deepgram/nova-2",
708
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
709
- )
710
- ASSEMBLYAI_UNIVERSAL_3_6_PRO =
711
- T.let(
712
- :"assemblyai/universal-3-6-pro",
713
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
714
- )
715
- ASSEMBLYAI_UNIVERSAL_3_5_PRO =
716
- T.let(
717
- :"assemblyai/universal-3-5-pro",
718
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
719
- )
720
- ASSEMBLYAI_UNIVERSAL_STREAMING =
721
- T.let(
722
- :"assemblyai/universal-streaming",
723
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
724
- )
725
- XAI_GROK_STT =
726
- T.let(
727
- :"xai/grok-stt",
728
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
729
- )
730
- SONIOX_STT_RT_V4 =
731
- T.let(
732
- :"soniox/stt-rt-v4",
733
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
734
- )
735
- SONIOX_STT_RT_V5 =
736
- T.let(
737
- :"soniox/stt-rt-v5",
738
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
739
- )
740
- HUMAIN_REALTIME =
741
- T.let(
742
- :"humain/realtime",
743
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
744
- )
745
- RESON8_TURNS =
746
- T.let(
747
- :"reson8/turns",
748
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
749
- )
750
-
751
- sig do
752
- override.returns(
753
- T::Array[
754
- Telnyx::AI::TranscriptionSettings::FallbackModel::Model::TaggedSymbol
755
- ]
756
- )
757
- end
758
- def self.values
759
- end
760
- end
761
- end
762
-
763
239
  # The speech to text model to be used by the voice assistant. All Deepgram models
764
240
  # are run on-premise.
765
241
  #